particular and general solution to second order differential, complex roots

The problem:

$y''+4y=0$, $y(0)=3$,$y'(0)=8$, $y_1=\cos2x$, $y_2=\sin2x$

find the general and particular solutions.

Well, allrighty, this should be simple enough. The characteristic equation is

$r^2+4=0$

which means the roots are $r_1=r_2=\sqrt{-4}=2i$

That means my general solution should look like this: $y=(c_1+c_2x)e^{2ix}$

And $y'=2ic_1e^{2ix}+2ic_2xe^{2ix}+c_2e^{2ix}$

I can solve for $c_1$ and $c_2$ using the initial conditions.

$y(0)=(c_1+c_2(0))e^{2i(0)}=c_1=3$

$y'(0)=2ic_1e^{2i(0)}+2ic_2(0)e^{2i(0)}+c_2e^{2i(0)}=2ic_1+c_2=8$

Therefore $2ic_1=6i$ so $c_2=8-6i$

That means my general solution should look like:

$y=(3+(8-6i)x)e^{2ix}=(3+8x-6ix)e^{2ix}$.

Using Euler's formula: $y=(3+8x-6ix)(\cos2x+i\sin2x)$

Multiply it out: $y=3\cos2x+3i\sin2x+8x\cos2x+8ix\sin2x-6ix\cos2x+6\sin2x$

$y=(3+8x-6ix)\cos2x+(3i+8ix+6)\sin2x$

But I know this is wrong. Or at least I think it is. Maybe it's right and the answer given in the book is wrong. So, I was curious if I misused Euler's formula, or the wrong general solution formula (Should I have used $y=(c_1+c_2)e^{2ix}$?) I'd love to know. Thanks.

• First, I don't know what $y_1$ and $y_2$ are in the statement of the problem. Second, $r^2+4=0$ has two solutions, $\pm2i$. So your general solution looks like $c_1e^{2ix}+c_2e^{-2ix}$. I don't know why you think there's a term with $xe^{2ix}$. If you are only looking for real solutions, the general solution is $c_1\cos2x+c_2\sin2x$. – Gerry Myerson Jun 26 '14 at 12:55
• AH! <i>two</i> solutions. That was it. I was using the general form for two equal and <i>real</i> solutions which won't apply here. – Jesse Jun 26 '14 at 12:59
• oh, we had to check that $y_1$ and $y_2$ were solutions and they are. – Jesse Jun 26 '14 at 13:29