# General Solution of 2nd Order Differential Equaiton

1. Oct 24, 2012

### mm391

1. The problem statement, all variables and given/known data

Find the general solution to d2y/dx2 +4y=cos(2x)

2. Relevant equations

3. The attempt at a solution

I have woked out what I think is the Complementary function C1sin(2x)+C2cos(2x) the reason it is cos and sin is because the roots are 2i and therefore the exponential and imaginary number turn it in to a cos or sin.

Particular Integral:
y = a cos(2x) + b sin(2x)
y' = -2a sin(2x) + 2b cos(2x)
y'' = 4a cos(2x) - 4b sin(2x)

∴ -4a cos(2x) + 4b sin(2x) + 4a cos(2x) - 4b sin(2x) = cos(2x)

but it all cancels out to give 0=cos(2x) which surely can't be right. Have I been staring at this so long that I cannot see the obvious answer?

2. Oct 24, 2012

### LCKurtz

Since cos(2x) and sin(2x) satisfy the homogeneous equation, of course when you plug any linear combination of them into it you are going to get zero. So they can't make the solution of the non-homogeneous equation. Your text should have a section about what to do when the right hand side is a solution of the homogeneous equation. Try$$y_p = Cx\cos(2x)+Dx\sin(2x)$$