# Solving a PDE by Fourier Series

I want to solve the following PDE: $$\begin{cases} u_t=u_{xx}+1\\ u_x(0,t)=0, \quad u(1,t)=0\\ u(x,0)=\cos\left(\frac{\pi}{2}x\right) \end{cases}$$ using a Fourier series.

The thing that is throwing me off is the $+1$ in the PDE. I tried using separation of variables and it got messy, since $u(x,t)=A(x)B(t) \implies A(x)B'(t)=A''(x)B(t)+1 \implies \frac{B'(t)}{B(t)}=\frac{A''(x)}{A(x)}+\frac{1}{A(x)B(t)}$ and so it cannot be said both sides are constant since the RHS has a term in $t$.

I know that $\cos\left(\left(\frac{\pi}{2}+n\pi \right)x\right)$ satisfies the required boundary conditions, and I could solve this for $u_t=u_{xx}$ quite easily to give a fourier series $$u(x,t)=\frac{a_o}{2}+\sum\limits_{n=1}^\infty a_n e^{-t(\pi(1/2+n))^2}\cos\left(\left(\frac{1}{2}+n\right)\pi x\right)$$ where $a_n=2\int_0^1\cos\left(\frac{\pi}{2}x\right)\cos\left(\left(\frac{\pi}{2}+\pi n\right)x \right)dx$. Due to orthogonality of these, I know that they simplify but I can't quite work out how since the coefficients of $x$ aren't integers.

Can I use this to find a solution for $u_t=u_{xx}+1$? Is it as simple as adding a $t$ term to the exponential term in the fourier series or does that ruin the result?

I then need to determine the limit $\displaystyle u_\infty(x)=\lim_{t \rightarrow \infty}u(x,t)$ explicitly, and I am not quite sure what that means.

• Consider $u(x,t) = F(x)G(t)-\frac{1}{2 }x^2$. – science Mar 30 '15 at 4:53
• Would it not be $+\frac{1}{2}x^2?$ – AccioHogwarts Mar 30 '15 at 5:56
• @AccioHogwarts science is correct in saying $-\frac 12 x^2$. Because $u_t=A(x)B'(t)$ and $u_{xx}=A''(x)B(t)-1$. Thus, $u_t = u_{xx}+1$ becomes $$A(x)B'(t)=A''(x)B(t).$$ – Cookie Mar 30 '15 at 6:14

I followed @science's hint with separation of variables, then applied your boundary and initial conditions, to obtain the solution $$u(x,t)=\frac{a_0}2+a_n e^{-(\frac{\pi}2 +2\pi n)^2 t} \cos\left(\left(\frac{\pi}2 +2\pi n\right)x\right)-\frac 12x^2,$$ where $$a_n = 2\int_0^1 \cos^2\left(\left(\frac{\pi}2 +2\pi n\right)x\right) \, dx$$ is a Fourier coefficient, for every $n\in \{0,1,2,3,4,\ldots\}$.
We know that $\lim_{t \to \infty} e^{-(\frac {\pi}2+2\pi n)^2t}=0$ and find $a_0=1$. Hence, we conclude $$u_\infty(x)=\lim_{t \to \infty} u(x,t)=\frac 12(1-x^2).$$
• Since it is a cosine series, would the $a_0$ term not also come out of the sum and thus be in the limit? – AccioHogwarts Mar 30 '15 at 5:57
$$u(x,t) = F(x)G(t) - \frac{1}{2 a_2}( a_2x^2+a_1x+a_0 ).$$