If I write it as:

$\displaystyle (D^2+\frac{k}{m})u=\frac{a}{m} e^{i\omega t}$

and apply the operator $\displaystyle (D^2+w^2)$ to both sides to annihilate the right side, and work through it, I get:

$\displaystyle u(t)=c_1 e^{i\sqrt{\frac{k}{m}} t}+c_2 e^{-i\sqrt{\frac{k}{m}}t}+\frac{a}{k-m\omega^2} e^{i\omega t}$.

In general if $\displaystyle k\in\mathbb{C}$ then:

$\displaystyle \displaystyle{

e^{i\sqrt{\frac{k}{m}}t}=\text{Exp}\left[\pm it(r^{1/2}e^{i/2\Theta})\right],\quad \Theta=Arg(k/m) },\quad r=|k/m|$

however, the solution above already contains both roots of the square root so that in the solution, $\displaystyle \sqrt{\frac{k}{m}}=r^{1/2}e^{\frac{i}{2}\theta}$, the principal value.

Also, if you're into Mathematica, here's the code to study a particular IVP numerically:

$\displaystyle u''+(1-\frac{i}{2})u=-\frac{1}{2}e^{it},\quad u(0)=1+i,\quad u'(0)=2-i$

Code:

eqn = Derivative[2][u][t] + (k/m)*u[t] ==
(a/m)*Exp[I*w*t] //. {k -> 2 - I,
m -> 2, w -> 1, a -> -1}
sol = NDSolve[{eqn, u[0] == 1 + I,
Derivative[1][u][0] == 2 - I}, u,
{t, 0, 5}]
p1 = Plot[{Re[Evaluate[u[t] /. sol]],
Im[Evaluate[u[t] /. sol]]},
{t, 0, 5}, PlotStyle -> {Red, Blue}]

And then the code to solve for the two constants and plot the analytic solution:

Code:

clist = First[{c1, c2} /. FullSimplify[
Solve[{c1 + c2 + a/(k - m*w^2) == u,
c1*I*Sqrt[k/m] - c2*I*Sqrt[k/m] +
(I*w*a)/(k - m*w^2) == v},
{c1, c2}] //. {k -> 2 - I, m -> 2,
w -> 1, a -> -1, u -> 1 + I,
v -> 2 - I}]]
solution = k1*Exp[I*Sqrt[k/m]*t] +
k2*Exp[(-I)*Sqrt[k/m]*t] +
(a/(k - m*w^2))*Exp[I*w*t] /.
{k -> 2 - I, m -> 2, w -> 1, a -> -1,
k1 -> clist[[1]], k2 -> clist[[2]]}
p2 = Plot[{Re[solution], Im[solution]},
{t, 0, 5}, PlotRange ->
{{0, 5}, {-3, 3}}, PlotStyle ->
{Red, Blue}]
Show[{p1, p2}]

and then plots of the real component of the solution in red and complex component in blue (pretty neat I think-- I never worked one like this before ):