# $2^{nd}$ order PDE: Solution

I am trying to solve the following equation: $$\frac{\partial F}{\partial t} = \alpha^2 \, \frac{\partial^2 F}{\partial x^2}-h \, F$$ subject to these conditions:

$$F(x,0) = 0, \hspace{5mm} F(0,t) = F(L,t)=F_{0} \, e^{-ht}.$$ I know that I am suppose to simplify the equation with: $$F(x,t)=\phi(x,t)e^{-ht}$$ My initial guess is to divide by $$\alpha^2$$ and have this: $$\frac{d^2F}{dx^2}-\frac{1}{\alpha^2}\frac{dF}{dt}-\frac{h}{\alpha^2} \, F=0.$$ I am having trouble with the next steps. Should I assume a solution of the exponential form?

• This is not a ODE, but a PDE. – Tryss Aug 7 '15 at 22:00

Given: $$\frac{\partial F}{\partial t} = \alpha^2 \, \frac{\partial^2 F}{\partial x^2}-h \, F$$ $$F(x,0) = 0, \hspace{5mm} F(0,t) = F(L,t)=F_{0} \, e^{-ht}.$$

The process to obtain a solution is the following.

The boundary conditions suggest making the substitution $F(x,t) = \phi(x,t) \, e^{-h t}$ for which the pde becomes $$\frac{\partial \phi}{\partial t} = \alpha^{2} \, \frac{\partial^{2} \phi}{\partial x^{2}}$$ where $\phi(x,0) = 0$, $\phi(0,t) = \phi(L,t) = F_{0}$. Now let $\phi(x,t) = F_{0} + \theta(x,t)$ which bring the equation and conditions into the form $$\frac{\partial \theta}{\partial t} = \alpha^{2} \, \frac{\partial^{2} \theta}{\partial x^{2}}$$ where $\phi(x,0) = - F_{0}$, $\phi(0,t) = \phi(L,t) = 0$.

Let $\theta(x,t) = f(x) \, g(t)$ to obtain \begin{align} \frac{g'}{g} = - \lambda^{2} = \alpha^{2} \, \frac{f''}{f} \end{align} for which \begin{align} & \alpha^{2} \, f'' + \lambda^{2} f = 0 \\ & g' + \lambda^{2} \, g = 0. \end{align} The first order equation has the solution $g(t) = e^{- \lambda^{2} \, t}$. The equation for $f$ has the form $f'' + (\lambda/\alpha)^{2} \, f=0$ with solutions $f(x) = A \, \cos(\lambda x/\alpha) + B \, \sin(\lambda x/\alpha)$. From the conditions $\phi(0,t)=\phi(L,t) = 0$ then \begin{align} 0 &= A \\ 0 &= A \, \cos\left(\frac{\lambda L}{\alpha}\right) + B \, \sin\left( \frac{\lambda L}{\alpha}\right) \end{align} for which $B \neq 0$ and $\sin\left(\frac{\lambda L}{\alpha}\right) = 0$. From this $$\lambda_{n} = \frac{n \, \pi \, \alpha}{L}.$$ Combining the parts leads to the $\theta(x,t)$ solution \begin{align} \theta(x,t) = \sum_{n=1}^{\infty} B_{n} \, \sin\left(\frac{n \, \pi \, x}{L}\right) \, e^{- \frac{n^{2} \, \pi^{2} \, t}{L^{2}} }\end{align} The remaining condition is $\theta(x,0)= - F_{0}$, \begin{align} - F_{0} = \sum_{n=1}^{\infty} B_{n} \, \sin\left(\frac{n \, \pi \, x}{L}\right) \end{align} The coefficients are obtained by Fourier series methods and are \begin{align} B_{m} = - \frac{2}{L} \, \int_{0}^{L} F_{0} \, \sin\left(\frac{m \, \pi \, u}{L}\right) \, du = - \frac{2 \, F_{0} \, (1 - (-1)^{m})}{m \, \pi}. \end{align} With all of this the solution becomes \begin{align} F(x,t) = F_{0} \, e^{-h t} - \frac{2 \, F_{0}}{\pi} \, e^{-h t} \, \sum_{n=1}^{\infty} \frac{1 - (-1)^{n}}{n} \, \sin\left(\frac{n \, \pi \, x}{L}\right) \, e^{- \frac{n^{2} \, \pi^{2} \, t}{L^{2}}}. \end{align} or \begin{align} F(x,t) = F_{0} \, e^{-h t} - \frac{2 \, F_{0}}{\pi} \, e^{-h t} \, \sum_{n=0}^{\infty} \frac{1}{2n+1} \, \sin\left(\frac{(2n+1) \, \pi \, x}{L}\right) \, e^{- \frac{(2n+1)^{2} \, \pi^{2} \, t}{L^{2}}}. \end{align}

• Can you explain how you obtained the coeffs with Fourier series method? I dont understand that step – Jackson Hart Aug 11 '15 at 20:39
• @JacksonHart $$\int_0^L\sin\left(\frac{m\pi u}{L}\right)du = \frac{L}{m\pi}\left[-\cos\left(\frac{m\pi u}{L}\right)\right]_0^L = \frac{L}{m\pi}\left[-\cos(m\pi)-(-\cos(0))\right]$$ now you need to realise that $$\cos(m\pi) = (-1)^m$$ – Chinny84 Aug 13 '15 at 16:01
• @Chinny84 I am still not sure where the $B_m$ came from where he set it equal to $\frac{-2}{L}$ etc – Jackson Hart Aug 13 '15 at 16:06
• @JacksonHart Here is a good display of how Fourier Sine series are obtained with some examples. – Leucippus Aug 13 '15 at 16:20
• @Chinny84 It is making more sense now..I understand how the coefficient Bm was obtained. Could you clarify the step after when you write out $F(x,t)$? Where does the initial $F_o e^{-ht}$ and the $e^{-ht}$ after the $\frac{2F_o}{\pi}$ come from? – Jackson Hart Aug 13 '15 at 16:37

(definitely too long for comment) ah he gets it by the orthogonality principle. so $$-F_0\sin\left(\frac{m\pi u}{L}\right) = \sum_{n=1}^\infty B_n\sin\left(\frac{n\pi u}{L}\right)\sin\left(\frac{m\pi u}{L}\right)$$ now from the orthogonality principle the integration over $u$ which is $$\int_0^L -F_0\sin\left(\frac{m\pi u}{L}\right) = \int_0^L\sum_{n=1}^\infty B_n\sin\left(\frac{n\pi u}{L}\right)\sin\left(\frac{m\pi u}{L}\right)du = \sum_{n=1}^\infty B_n \int_0^L\sin\left(\frac{n\pi u}{L}\right)\sin\left(\frac{m\pi u}{L}\right)du$$ and looking at the integral within the summation $$\int_0^L\sin\left(\frac{n\pi u}{L}\right)\sin\left(\frac{m\pi u}{L}\right)du = \frac{L}{\pi}\int^\pi_0\sin(nx)\sin(mx)dx = I(\pi)$$ we also have $$\frac{L}{\pi}\int^{-\pi}_0\sin(-nx')\sin(-mx')(-dx') = - \frac{L}{\pi}\int_0^{-\pi}\sin(nx')\sin(mx')dx' =\frac{L}{\pi}\int^0_{-\pi}\sin(nx')\sin(mx')dx'$$ the last integral has the equivelent value as $I(\pi)$ thus we have $$\frac{L}{\pi}\int^\pi_{-\pi}\sin(nx)\sin(mx)dx = \frac{L}{\pi}\int^0_{-\pi}\sin(nx')\sin(mx')dx' + \frac{L}{\pi}\int^\pi_0\sin(nx)\sin(mx)dx = 2I(\pi)$$ so we get $$I(\pi) = \frac{L}{2\pi}\int^\pi_{-\pi}\sin(nx)\sin(mx)dx$$ the reason I go this long way is to show each step to the integral i want and that is $$\int^\pi_{-\pi}\sin(nx)\sin(mx)dx = \pi \delta_{nm}$$ which is a delta function and thus only has non-zero value when $n=m$ thus we have $$\int_0^L -F_0\sin\left(\frac{m\pi u}{L}\right)= \sum_{n=1}^\infty B_n \int_0^L\sin\left(\frac{n\pi u}{L}\right)\sin\left(\frac{m\pi u}{L}\right)du = \sum_{n=1}^{\infty}B_n\frac{L\cdot\pi\delta_{nm}}{2\pi}$$ the only nonzero component is when $n=m$ thus the only component of the sum that is non zero is that case. $$\int_0^L -F_0\sin\left(\frac{m\pi u}{L}\right)= \sum_{n=1}^\infty B_n \int_0^L\sin\left(\frac{n\pi u}{L}\right)\sin\left(\frac{m\pi u}{L}\right)du = B_m\frac{L}{2}$$ thus the coefficient is (here you could of had $n$ instead of $m$ but its obvious to choose $m$) $$-\frac{2}{L}\int_0^L F_0\sin\left(\frac{m\pi u}{L}\right) = B_m$$

• thanks for writing all that out! Could you clarify my other comment in the other answer as well? not sure where 2 of the exponentials come from, especially, where does the h come in? I did not see it anywhere else before – Jackson Hart Aug 13 '15 at 16:39
• I am not entirely clear on plugging back in to get the final solution – Jackson Hart Aug 13 '15 at 17:18
• @JacksonHart How are you missing the $h$ term? It is in your proposed problem. – Leucippus Aug 13 '15 at 17:26
• @Leucippus I mean I see the h, but i do not see where the first 2 terms in your next to last solution in your answer are. I do not see where the initial F_o term with exp and the exp in the 2nd term comes from. could you expand your answer to show this. – Jackson Hart Aug 13 '15 at 17:27
• jacksonhart the $2n+1$ arises by subtle change of indices (since we have a countable infinty we can shift the index). So looking at the result of @leucippus $1-(-1)^n$ Is zero for even $n$ so only odd integers will give non-zero components. Therefore you are looking. For $n=2k+1$ but since $n,k$ are just labels and like I said are infinte in nature you can use $n\to 2n+1$. Where ever $n$ Is in the original equation. – Chinny84 Aug 13 '15 at 21:41

Let $F(x,t) = \phi(x,t) e^{-ht}$

Then

$$\frac{\partial}{\partial t}\left( \phi(x,t) e^{-ht} \right) = \alpha^2 \frac{\partial^2}{\partial x^2}\left( \phi(x,t) e^{-ht} \right) - h\left( \phi(x,t) e^{-ht} \right)$$

Hence

$$\frac{\partial \phi}{\partial t}(x,t) e^{-ht} - h\phi(x,t)e^{-ht} = \alpha^2 \frac{\partial^2 \phi}{\partial x^2}(x,t) e^{-ht} - h\phi(x,t) e^{-ht}$$

So

$$\frac{\partial \phi}{\partial t}(x,t) = \alpha^2 \frac{\partial^2 \phi}{\partial x^2}(x,t)$$

And $\phi$ is a solution of the classical heat equation (you can easily find the initial and boundary conditions of this equation)

• I am confused: I already said what the boundary conditions were. Why are you saying I need to find other B.C.s/ – Jackson Hart Aug 7 '15 at 22:53
• @JacksonHart : your boundary conditions are for $F$ and your first equation, not for $\phi$ and the heat equation. – Tryss Aug 7 '15 at 22:56
• In your answer above, I do not see that you applied any of the B.C.'s for F but instead we now are evaluating wrt phi. But why would we be given the B.C.'s for F if we were not suppose to use them? – Jackson Hart Aug 7 '15 at 23:07
• OK, I am up to speed with everything except not understanding why we dont ever use the B.C.'s that were provided. Why would the professor give us B.C.'s if we are just suppose to go find other ones? – Jackson Hart Aug 7 '15 at 23:26

The following field redefinition, similar to what the other answers have done, simplifies the problem:

$$F = (F_0 + \phi)e^{-ht} \implies \frac{d\phi}{dt} = \alpha^2\frac{d^2\phi}{dx^2}$$

with $\phi(0,t) = \phi(L,t) = 0$ and $\phi(x,0) = -F_0$. One can now proceed with your favoritte method like separation of variables or expanding $\phi$ in a Fourier series to obtain an equation for the coefficients.

The other answers have done this so I just want to focus on a problem one encounters when applying the initial condition. No matter what approach you take you will be lead to a Fourier series and to evaluate the coefficients you need to apply the initial condition $\phi(x,0) = -F_0$. This function does not have a non-trivial Fourier-series so a naive application would not give a solution. The usual trick to get around this is by extending the domain of $\phi$ from $[0,L]$ to $[-L,L]$ and then demaning $\phi(x,t)=-\phi(-x,t)$, i.e. we demand that the solution should be odd (since the odd completion do have a nice Fourier series). For the initial condition we therefore consider

$$\phi(x,0) = -F_0\left\{\matrix{-1 & x<0 \\1 & x > 0}\right.$$

This function, the so-called square-wave, has the Fourier series

$$\phi(x,0) = -\frac{4F_0}{\pi}\sum_{n=0}^\infty\frac{1}{2n+1}\sin\left(\frac{(2n+1)\pi x}{L}\right)$$

which can be found by applying the usual method.

Just for completeness, here is a quick runthough of the solution. We expand $\phi$ in a Fourier $\sin$-series (since we demand that $\phi$ is odd) $\phi(x,t) = \sum_{n=1}^\infty a_n(t) \sin\left(\frac{n\pi x}{L}\right)$ that satisfy the boundary conditions $\phi(0,t)=\phi(L,t) = 0$. By inserting this series into the PDE and equating the left and right hand side we get the equation for the coefficients

$$\frac{da_k}{dt} = -\frac{n^2\pi^2\alpha^2}{L^2} a_k \implies a_k(t) = a_k(0) e^{-\frac{n^2\pi^2\alpha^2}{L^2}t}$$

where $a_k(0)$ is simply the Fourier coefficients of the initial condition which here is just the square-wave given above. The full solution can therefore be written

$$F(x,t) = F_0e^{-ht}\left[1 - \frac{4}{\pi}\sum_{n=0}^\infty\frac{e^{-\frac{(2n+1)^2\pi^2 \alpha^2}{L^2}t}}{2n+1}\sin\left(\frac{(2n+1)\pi x}{L}\right)\right]$$

for all $t>0$ and $0\leq x\leq L$. Note that the formula above is not valid for $t=0$ at the two points $x=0$ and $x=L$ since we get $F(x,0)=F_0$ instead of $F(x,0)=0$.

• Nice solution and it looks rather familiar. – Leucippus Aug 13 '15 at 21:25