I am trying to solve an equation with two variables. It is the last step in the process of using the method of undetermined coefficients to solve a nonhomogeneous differential equation. The equation is this:
$$y''-5y'+6y=e^tcos(2t)+e^{2t}(3t+4)sin(t)$$
My first particular equation is
$$Y(t)=e^t(Acos(2t)+Bsin(2t))$$
and I need to find A and B values that satisfy:
$$y''-5y'+6y=e^tcos(2t)$$
Plugging $Y(t)$ into the equation gives:
$$-2 e^t ((A+3B) cos(2 t)-(3 A + B) sin(2 t))=e^tcos(2t)$$
So A and B must satisfy:
$$A+3B=-1/2$$ $$B-3A=0$$
And then A and B are easy to solve for.
However, putting the equation into Solve[] gives an error:
Solve[{-2 Exp[t] ((a + 3 b) Cos[2 t] + (-3 a + b) Sin[2 t]) == Exp[t] Cos[2 t]}, {a, b}]
Solve::svars: Equations may not give solutions for all "solve" variables. >>
And the output just gives B in terms of A and t. This particular problem I can solve on paper, but others are much more complex. I need a way to solve an equation like this using Mathematica to save time. This is homework from Boyce Elementary Differential Equations 10, Section 3.5 #23.
EDIT: Made variable names lower case
Solve[{-2 Exp[t] ((n + 3 m) Cos[2 t] + (-3 n + m) Sin[2 t]) == Exp[t] Cos[2 t]}, {n, m}]
which gives me{{n -> -0.05, m -> -0.15}}
. You probably assigned something different toA
andB
, so you need to clear them. Also, it is not a good practice to use upper-case letters as vars, functions, etc as they are built-in symbols. $\endgroup$