I'd like to solve this equation:
$$ u_t = u_{xx} + u_x $$ for $t>0$ with initial condition: $$ u(0,x) = \cos (2 \pi x) $$ And $1$-periodic, i.e we have that $u(t,x) = u(t,x+1).$ I was going to solve it using separation of variables, but I was thinking another way, namely solving it using a fourier series. I.e, first I assume that $u$ has fourier series expansion: $$ u(t,x) = \sum_{k \in \mathbb{Z}} a_k(t)e^{2\pi ikx} $$ Now, I would like to differentiate the coefficients in the series and set them equal to each other. Something akin to: $$ a_k'(t) = 2\pi ike^{2\pi i k x} ak(t) + (2 \pi ik )^2 ak(t) e^{2 \pi i k x} $$ And then solve for $ak(t)$. Two questions: 1) is this method valid? I.e is it true that the series are equal if and only if the coefficients are? 2) If I can use this method, how do I solve the ODE for $a_k(t)$? Apologies if this is particularly obvious, I have never taken an ODEs class