Before we can even get to whatever semantic problem there might be, we need to fix up your code problems.
L[t, x] = x''''[t] + 5 x''[t] + 4 x[t]
The above is probably not what you want. What that did is define a replacement rule for the exact expression L[t, x]
, which means it won't evaluate as you expect when you pass in any other arguments. For example:
L[t, x]
(* 4*x[t] + 5*Derivative[2][x][t] + Derivative[4][x][t] *)
L[t, Exp[m #] &]
(* L[t, Exp[m #1] &] *)
So, you need to use patterns:
L[t_, x_] = x''''[t] + 5 x''[t] + 4 x[t];
L[t, Exp[m #] &]
(* 4*E^(m*t) + 5*E^(m*t)*m^2 + E^(m*t)*m^4 *)
And to avoid symbol collisions, you should probably use SetDelayed
:
L[t_, x_] := x''''[t] + 5 x''[t] + 4 x[t]
Probably safest to do what with CharPoly
as well:
CharPoly[m_] := Coefficient[L[t, Exp[m #] &], Exp[m t]]
Next is just a simplification. Instead of
roots = m /. Solve[CharPoly[m] == 0, m]
you can just do
roots = SolveValues[CharPoly[m] == 0, m]
Now, when we get to
AllSolns[t_] = Solns /. {c1, c2, c3, c4}
we've really jumped the rails. This doesn't make any sense. You have an argument t_
that isn't used anywhere. I'll assume that the suggestion from Denis Ivanov is what you actually intended. And we can just replace that in directly to get
Simplify[L[t, Solns . {c1, c2, c3, c4}] == 0]
which gives
4*((c3 + c1*E^(I*t) + c2*E^((3*I)*t) + c4*E^((4*I)*t))/E^((2*I)*t))[t] +
5*Derivative[2][(c3 + c1*E^(I*t) + c2*E^((3*I)*t) + c4*E^((4*I)*t))/E^((2*I)*t)][t] +
Derivative[4][(c3 + c1*E^(I*t) + c2*E^((3*I)*t) + c4*E^((4*I)*t))/E^((2*I)*t)][t] == 0
Is that what you wanted?