Solve $u_t=u_{xx}+u_x$ For $u:\mathbb{R}\times [0,1]$ with boundary conditions $u(0,x)=\cos (2\pi x)$ and $u(t,0)=u(t,1)$. 
Solve $u_t=u_{xx}+u_x$.
I had this on an exam and tried to write $u$ as a product of two single variate functions and convert to an ode using the usual methods but things got messy and I couldn't finish. I also tried to write $u$ as a Fourier series in $x$ with coefficients $a_k(t)$ depending on $t$, but this also didn't seem to yield anything.
Is there a more clever way to approach this, possibly with Fourier series? I heard from a friend there may be a Fourier transform method since the equation was "homogeneous in momentum space." 
Thanks!
 A: The Fourier series method should work! (I would definitely go for Fourier series rather than Fourier transforms, since your solution is meant to be periodic in $x$.)
Having said that, your initial condition only involves $\cos(2\pi x)$, so I would be tempted to try an ansatz of the form,
$$ u(t,x) = a(t) \cos(2\pi x) + b(t) \sin(2\pi x).$$
The PDE gives
\begin{multline} \dot a(t) \cos (2\pi x) + \dot b(t)\sin(2\pi x)\\ = (-4\pi^2 a(t)+2\pi b(t))\cos(2\pi x) +(-2\pi a(t)-4\pi^2b(t))\sin(2\pi x).\end{multline}
So we need to solve the ODEs
$$ \frac{d}{dt}\left[ \begin{array}{c} a(t) \\ b(t) \end{array}\right] = \left[\begin{array}{cc} -4\pi^2 & 2\pi \\ - 2\pi & -4\pi^2 \end{array} \right]\left[ \begin{array}{c} a(t) \\ b(t) \end{array}\right]$$
and the initial conditions (coming from the initial conditions for the PDE) are
$$ a(0) = 1, \ \ \ \ \ b(0) = 0.$$
We can solve this ODE by finding the eigenvalues and eigenvectors of the matrix. The result is
$$ \left[ \begin{array}{c} a(t) \\ b(t) \end{array}\right] = \frac 1 2 \left[ \begin{array}{c} 1 \\ i \end{array}\right] \exp((-4\pi^2 + 2\pi i)t) +  \frac 1 2 \left[ \begin{array}{c} 1 \\ -i \end{array}\right] \exp((-4\pi^2 - 2\pi i)t)$$
i.e.
$$ a(t) = \exp(-4\pi^2 t) \cos(2\pi t), \ \ \ b(t) = -\exp(-4\pi^2 t) \sin(2\pi t).$$
A: Since $u$ is 1 periodic in $x$, we may write
$$
u(x,t)=\sum_{k\in \mathbb{Z}}a_k(t)e^{2\pi i kx}
$$
and our condition that $u$ be a solution yields
$$
u_t(x,t)=u_{xx}+u_x\implies \sum_{k\in \mathbb{Z}}a_k'(t)e^{2\pi i kx}=\sum_{k\in \mathbb{Z}}(2\pi i k -4\pi ^2k^2)a_k(t)e^{2\pi i kx}\implies
$$
yielding the ordinary differential equation
$$
(2\pi i k -4\pi ^2k^2)a_k(t)=a_k'(t)\implies a_k(t)=C_ke^{(2\pi i k -4\pi ^2k^2)t}
$$
and thus
$$
u(x,t)=\sum_{k\in \mathbb{Z}}C_ke^{(2\pi i k -4\pi ^2k^2)t}e^{2\pi i kx}
$$
With the condition that $u(0,x)=\cos (2\pi x)$, we have
$$
\cos(2\pi x)=\sum_{k\in \mathbb{Z}}C_ke^{(2\pi i k -4\pi ^2k^2)t}e^{2\pi i kx}
$$
Since $C_k=\int_0^1\cos(2\pi x)e^{-2\pi ki x}\mathrm dx$, we have vanishing of all but the $k=1$ terms, with $C_1=C_{-1}=1/2$ which yields the solution 
$$
u(x,t)=e^{-4\pi ^2t}\frac{1}{2}(e^{2\pi i (x+t)}+e^{-2\pi i (x+t)})=e^{-4\pi ^2t}\cos [2\pi (x+t)]
$$
A: On the exam I suspect we both took, I solved this the following way (I suspect this answer will be useful since we never learned to employ fourier series in our class the way the other answers presciently suggest):
Suppose we can separate variables; $u(x,t) = X(x)T(t).$ Then the equation reads
$$X(x)T'(t) = X''(x)T(t) + X'(x)T(t).$$
Divide by the solution (if you're uncomfortable with this, look up "separation of variables divide by zero" to find the relevant explanation on this website) to find
$$\frac{T'(t)}{T(t)} = \frac{X''(x) + X'(x)}{X(x)}.$$
Realize that each side of the equation above is constant; call this constant $\chi.$ Solve the equation
$$0 = X''(x) + X'(x) - \chi X(x)$$
by the means familiar to you from Math 27300. I.e., commit yourself to the ansatz $X(x) = \mathrm{Re}(A_n\mathrm{e}^{i \omega_n x})$ and write down the characteristic polynomial
$$-\omega_n^2 + \mathrm{i} \omega_n - \chi = 0$$
Then also impose the condition that
$$X(x) = X(x+1),$$
which mandates that $\omega_n = 2\pi n$ for $n \in \mathbf{N}.$
Solve for $\chi$ in the characteristic polynomial; then going back to our variable-separated differential equation for $T$ we can write
$$T'(t) = \chi T(t) = (-4\pi^2 n^2 + \mathrm{i} (2\pi n))T(t).$$
You have again the opportunity to make your Basic Theory of Ordinary Differential Equations instructor proud by employing the ansatz 
$$T(t) = \mathrm{Re}\left[ B_n  \, \mathrm{e}^{(-4\pi^2 n^2 + 2\pi \mathrm{i} n )t}\right]$$
but you would be justifiably chastised if you were not to notice that the solution to the original PDE will hence be obtained by the Ansatz
$$u(t,x) = \mathrm{Re}\left[ \sum_{n \in \mathbb{N}}  \mathrm{e}^{(-4\pi^2 n^2 + 2\pi \mathrm{i} n )t} (a_n \cos(2 \pi x) + \mathrm{i}\, b_n \sin (2\pi x))\right]$$
since you realize that the second-order ODE for $X$ requires two undetermined constants per $\omega_n$ and you must take real parts at the end of the calculation for a linear combination of complex ansätze which each satisfy the original PDE.
Now simply apply the initial condition. It's easier if we notice
$$u(0,x)=\cos(2\pi x) = \mathrm{Re}[\mathrm{e}^{2\pi x}]$$
so we can use our knowledge of orthogonal functions to realize
$$a_n = b_n = 1 \, \, \mathrm{for} \, \, n = 1$$
and $0$ otherwise. Then
\begin{align*}
u(t,x) &= \mathrm{Re}\left[\mathrm{e}^{(-4\pi^2 + 2\pi \mathrm{i})t}(\cos{2\pi x} + \mathrm{i}\sin{2 \pi x})\right] \\
&= \mathrm{e}^{-4\pi^2 t}[\cos(2\pi t)\cos(2 \pi x) - \sin(2 \pi t) \sin (2 \pi x)].
\end{align*}
