# General solution of a differential equation

#### Beard

Hi,

I have to solve the general equation for this differential

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

I have the homogeneous equation as $$\displaystyle (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 $$\displaystyle y_{PI} = k(something)$$ I have tried using sin(x) but that gets difficult to untangle

Thanks

Beard

#### HallsofIvy

MHF Helper
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.

• Beard

#### Beard

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.