I'm trying to solve $u_t = iu_{xx}+2iu$ where we know $u(0,x) = \cos(2\pi x)-i\sin(2\pi x)$, $0 \leq x < 1$, $0 \leq t$ with periodic boundary conditions.
This is what I tried:
Assume $u(t,x) = T(t)X(x)$, then we have $T'(t)X(x) = iT(t)X''(x)+2iT(t)X(x)$, or in other words $\frac{T'(t)}{T(t)} = i\frac{X''(x)}{X(x)} + 2i = \lambda \in \mathbb C$
The general solution to the ODE $\frac{T'(t)}{T(t)} = \lambda$ is $T(t) = c_1 e^{\lambda t}$
The solution to the ODE $i\frac{X''(x)}{X(x)} + 2i = \lambda$ is $X(x) = c_2e^{i\sqrt{2+i\lambda}x} + c_3e^{-i\sqrt{2+i\lambda}x}$
So overall we have $u(t,x) = c_1 e^{\lambda t}(c_2e^{i\sqrt{2+i\lambda}x} + c_3e^{-i\sqrt{2+i\lambda}x}) = e^{\lambda t}(\tilde{c_1}e^{i\sqrt{2+i\lambda}x} + \tilde{c_2}e^{-i\sqrt{2+i\lambda}x})$
Now I have 3 unknowns, $\tilde{c_1}, \tilde{c_2}, \lambda$. How can I find them using the initial condition and the periodic boundary conditions? I'm stuck here.
Try it the other way around
\begin{cases} \frac{X''}{X} = \lambda \\ \frac{T'}{T} = i(\lambda+2) \end{cases}
Solving the $X$ equation with periodic B.C.s gives
$$ X_n(x) = e^{i2\pi nx}, \quad n = 0, \pm 1, \pm 2, \dots $$
and $\lambda_n = -(2\pi n)^2$
The general solution is
$$ u(t,x) =\sum_{n=-\infty}^\infty a_ne^{i2\pi nx} e^{i(2-4n^2\pi^2)t} $$
where $a_n \in \Bbb Z$.
The initial condition gives
$$ u(0,x) = \sum_{n=-\infty}^\infty a_ne^{i2\pi nx} = e^{-i2\pi x} $$
Thus $a_{-1}=1$ and every other coefficient is zero.
The final solution is
$$ u(t,x) = e^{-i2\pi x}e^{i(2-4\pi^2)t} $$
Edit: The $X$ solutions were found by simple observation, since all functions of the form $e^{i2\pi nx}$ have a period of $1$. You can also consider the general solution $X(x) = e^{\sqrt{\lambda} x}$ and apply the B.C.'s
$$ X(0) = X(1) \implies 1 = e^{\sqrt{\lambda}} \implies \sqrt{\lambda} = i2\pi n $$