# Help solving a PDE similar to the heat equation

In my course on PDEs, I was given this PDE similar to the heat equation, which we solve for $$t \geq 0$$ and $$0 \leq x \leq 1$$

$$u_t=\alpha u_{xx} + u$$ with $$\alpha$$ a positive constant. The conditions provided are $$u_x(0,t)=u_x(1,t)=0$$ and $$u(x,0)=\sin^2(\pi x)$$.

I was not told how to solve this equation. This looks similar to the heat equation which I know can be solved using separation of variables. I am not very familiar with separation of variables or Fourier series, so I was wondering, can this be solved with separation of variables? I found myself unable to solve this equation using separation of variables, probably due to lack of familiarity. Can anyone please show me how to solve this? I thank all helpers.

• Try again. You just have to use Separation of Variables in exactly the same way. Jan 22, 2021 at 20:42

Separation of variables definitely works. $$f(x)g'(t)=\alpha f''(x)g(t)+f(x)g(t)$$ Divide through by $$f(x)g(t)$$: $$\frac{g'(t)}{g(t)}=\alpha \frac{f''(x)}{f(x)}+1=\text{constant}=-K$$ So you have some differential equations $$g'(t)=-K~g(t)$$ $$f''(x)=-\frac{K+1}{\alpha} f(x)$$ More work... $$g(t)=b e^{-K t}$$ $$f(x)=a_1 \sin\left(\sqrt{\frac{K+1}{\alpha}}x\right)+a_2 \cos\left(\sqrt{\frac{K+1}{\alpha}}x\right)$$ Meaning our $$x$$ partial derivative is $$\partial_x u(x,t)=be^{-Kt}\sqrt{\frac{K+1}{\alpha}}\left(a_1 \cos\left(\sqrt{\frac{K+1}{\alpha}}x\right)-a_2 \sin\left(\sqrt{\frac{K+1}{\alpha}}x\right)\right)$$ So our boundary conditions are $$\partial_x u(0,t)=0\implies a_1 \cos\left(\sqrt{\frac{K+1}{\alpha}}\cdot 0\right)-a_2 \sin\left(\sqrt{\frac{K+1}{\alpha}}\cdot 0\right)=0$$ $$\implies a_1=0$$ Let's rename $$b\cdot a_2 \to C$$ $$u(x,t)=C\cdot e^{-Kt} \cos\left(\sqrt{\frac{K+1}{\alpha}}x\right)$$ Can you perhaps apply the second boundary condition now? EDIT: The second boundary condition yields $$\sin\left(\sqrt{\frac{K+1}{\alpha}}\right)=0\implies \sqrt{\frac{K+1}{\alpha}}=n\pi$$ So we have separation constants $$K_n = \alpha n^2\pi^2 -1$$ Meaning our full solution is an arbitrary linear combination (for choices of $$\{C_n\}$$ that converge) $$u(x,t)=\sum_{n=0}^\infty C_n e^{-(n^2\pi^2-1)t}\cos\left(n\pi x\right)$$ Meaning $$u(x,0)=\sum_{n=0}^\infty C_n \cos\left(n\pi x\right)$$ But also $$u(x,0)=\sin^2(\pi x)=\frac{1}{2}-\frac{1}{2}\cos(2\pi x)$$ So $$C_0=1/2$$, $$C_2=-1/2$$, and all others are $$0$$.

• @kroner See edit. Jan 23, 2021 at 3:08
• @kroner See second edit. Jan 23, 2021 at 3:36
• @kroner Whoops, yes you're right. Jan 23, 2021 at 4:56

Make the substitution

$$v = e^{-t}u$$

then

$$v_t = -e^{-t}u + e^{-t}u_t$$ $$v_{xx} = e^{-t}u_{xx}$$

$$u_t = \alpha u_{xx} + u$$

$$u_t-u-\alpha u_{xx} = 0$$

Multiply across by $$e^{-t}$$

$$e^{-t}u_t-e^{-t}u-e^{-t}\alpha u_{xx} = 0$$

Plugging in what you derived

$$v_t - \alpha v_{xx} = 0$$

For initial conditions:

$$v_x(0,t) = e^{-t}u_x(0,t) = e^{-t}(0)= 0$$

$$v_x(1,t) = e^{-t}u_x(1,t)= e^{-t}(0) = 0$$

$$v(x,0) = e^{0}u(x,0) = \sin^2(\pi x)$$

Hence solve the system (Heat Equation):

$$v_t - \alpha v_{xx} = 0$$

$$v_x(0,t) = 0$$

$$v_x(1,t) = 0$$

$$v(x,0) = \sin^2(\pi x)$$

$$v = e^{-t}u$$
$$u = e^{t}v$$