I need help with the first part mostly!

The Question:

$\displaystyle \frac { { d }^{ 2 }y }{ { d }t^{ 2 } } +y=\quad (2cosx)+\quad (2){ e }^{ x }$

for the associated homogeneous

D = d/dx

$\displaystyle (D^2 + 1)y = 0 $

roots a = b = i

Trial solution:

$\displaystyle y = (A +Bx)e^ix $

when you sub it into the homogeneous, the real parts cancel but the imaginary doesn't!

$\displaystyle -Ae^ix -Bxe^ix + 2Bie^ix +Ae^ix +Bxe^ix $

I was wondering why this is?

Am i right in thinking the trial solution is wrong?

For the particular solutions of the other parts I got

for $\displaystyle 2cosx $

I got $\displaystyle { y }_{ 2 } = x^2cosx$

for $\displaystyle 2{ e }^{ x }$

I got $\displaystyle { e }^{ x }$

please verify these!

thanks