I guess you mean: y"+2iy'-y=ex-2iex.
First solve y"+2iy'-y=0 to get the characteristic equation, yc.
We have (r+i)2=0, because y"+2iy'+i2y=y"+2iy'-y=0.
yc=Ae-ix+Bxe-ix. Note that e-ix=cos(x)-isin(x).
The particular solution, yp=u1e-ix+u2xe-ix, where u1 and u2 are functions of x. We find them using Wronskian determinants w, w1, w2, and Cramer's Rule for solving simultaneous equations.
w=
| e-ix xe-ix |
| -ie-ix -ixe-ix+e-ix | = e-2ix. Note that e-2ix=cos(2x)-isin(2x).
w1=
| 0 xe-ix |
| ex-2iex -ixe-ix+e-ix | = -xex-ix+2ixex-ix=xex-ix(-1+2i).
w2=
| e-ix 0 |
| -ie-ix ex-2iex | = ex-ix-2iex-ix=ex-ix(1-2i). Note that ex-ix=ex(cos(x)-isin(x)).
u1=w1/w=xex+ix(-1+2i); u2=w2/w=ex+ix(1-2i).
yp=xex+ix(-1+2i)e-ix+xex+ix(1-2i)e-ix=xex(-1+2i)+xex(1-2i)=0.
Therefore, y=yc=Ae-ix+Bxe-ix=(A+Bx)(cos(x)-isin(x)) or (A+Bx)e-ix.