Solving an ODE

If I wanted to solve this $y''+3iy'+y=cos(2t)$ using undetermined coefficients.
and I make the guess $y=Ae^{2it}$
then i find y' and y'' and then solve for A. I get that A=-1/9
then I take the real part when I multiply it to Eulers formula.
But when I plug this back in to check it doesn't work.
Is there something weird going on because I have an imaginary coefficient in front of the y'.

If I wanted to solve this $y''+3iy'+y=cos(2t)$ using undetermined coefficients.
and I make the guess $y=Ae^{2it}$
then i find y' and y'' and then solve for A. I get that A=-1/9
then I take the real part when I multiply it to Eulers formula.
But when I plug this back in to check it doesn't work.
Is there something weird going on because I have an imaginary coefficient in front of the y'.

Better, try : y = A exp(2it) +B exp(-2it)
with cos(2t) = (1/2)exp(2it) + (1/2)exp(-2it)

$$y_p=A\cos(2t)+B\sin(2t)$$