# Thread: General solution of a differential equation

1. ## General solution of a differential equation

Hi,

I have to solve the general equation for this differential

$\frac{d^2y}{dx^2} - 6\frac{dy}{dx} + 9y = 50\sin(x)$

I have the homogeneous equation as $(A + Bx)e^{3x}$

However now that I am trying to get the partial equation I am stuck, I am unsure as what to use for the $y_{PI} = k(something)$ I have tried using sin(x) but that gets difficult to untangle

Thanks

Beard

2. You will need both sine and cosine:

y= A cos(x)+ B sin(x)

y'= -Asin(x)+ Bcos(x)

y"= -Acos(x)- Bsin(x)

y"- 6y+ 9y= -Acos(x)- Bsin(x)- 6Asin(x)+ 6Bcos(x)+ 9Acox(x)+ 9Bsin(x)

= (-A+ 6B+ 9A) cos(x)+ (-B- 6A+ 9B) sin(x)

= (8A+ 6B) cos(x) + (8B- 6A) sin(x)= 50 sin(x)

Solve 8A+ 6B= 0, 8B- 6A= 0 for A and B.

3. Originally Posted by HallsofIvy
You will need both sine and cosine:

y= A cos(x)+ B sin(x)

y'= -Asin(x)+ Bcos(x)

y"= -Acos(x)- Bsin(x)

y"- 6y+ 9y= -Acos(x)- Bsin(x)- 6Asin(x)+ 6Bcos(x)+ 9Acox(x)+ 9Bsin(x)

= (-A+ 6B+ 9A) cos(x)+ (-B- 6A+ 9B) sin(x)

= (8A+ 6B) cos(x) + (8B- 6A) sin(x)= 50 sin(x)

Solve 8A+ 6B= 0, 8B- 6A= 0 for A and B.
I wasn't actually expecting all of that, I was just asking for the first bit y= A cos(x)+ B sin(x) but thanks anyway.