Differential Equations Help

emmaw20

New member
Joined
Nov 5, 2014
Messages
1
Find the general solution to the differential equation:
y'' + 3y' + 2y = cosx

I know how to find the homogeneous solution and I started solving for the particular solution:

y = acosx + bsinx
y' = -asinx + bcosx
y'' = -acosx - bsinx

and I ended up with:

cosx(a-3b) + sinx(b-3a) = cosx

I wasn't sure what to do after that, so I checked my professor's answer key and she had:

a-3b=1
b-3a=0

How do I know that I'm supposed to set a-3b equal to 1 and b-3a equal to 0. I just don't understand where she got those numbers. Any help would be appreciated. Thanks!
 
I presume you mean you got (a- 3b) cos(x)+ (b- 3a)sin(x)= cos(x)= (1)cos(x)+ 0(sin(x)).
(the way you wrote it, it looks like "a- 3b" and "b- 3a" are multiplying x, inside the trig functions.)

That is to be true for all x so if you take x= 0 you get a- 3b= 1 and if you take \(\displaystyle x= \pi/2\) you get b- 3a= 0.

Though your teacher probably used a slight more "sophisticated" to get that: "sin(x)" and "cos(x)" are independent functions: if A sin(x)+ B cos(x)= 0 (for all x) then we must have A= B= 0. In other words, you cannot choose other values for A and B so that A sinx) and B cos(x) "cancel". There are a number of ways you can prove that. One is what I used above: if x= 0, A sin(0)+ B cos(0)= A(0)+ B(1)= 0 so B= 0. If \(\displaystyle x= \pi/2\), \(\displaystyle A sin(\pi/2)+ B cos(\pi/2)= A(1)+ B(0)= 0 so A= 0.

Or, after having let x= 0 to be B= 0, take the derivative. Since A sin(x)+ B cos(x)= 0, a constant, for all x its derivative is 0: A cos(x)- B sin(x)= 0. Now let x= 0 again: A cos(0)- B sin(0)= A(1)- B(0)= A= 0.


From "if A sin(x)+ B cos(x)= 0 for all x, then A= B= 0" we can immediately get "if A sin(x)+ B cos(x)= p sin(x)+ q sin(x) for all x and specific numbers, p and q, then A= p and B= q" by rewriting A sin(x)+ B cos(x)= p sin(x)+ q cos(x) as (A- p) sin(x)+ (B- q) cos(x)= 0.\)
 
Last edited:
Top