9

Suppose $u(x,t)$ solves \begin{align} u_t&=u_{xx}, \qquad 0 < x < \pi/2,\ t>0,\\ u(0,t)&=e^{-t},\\ u(\pi/2, t)&=t,\\ u(x,0)&=\cos(3x). \end{align}

I was following a method outlined in Boundaries in heat equation and set

$$u(x,t) = v(x,t) + e^{-t} + {2x \over \pi }\left(t - e^{-t}\right),$$

obtaining:

$$v_t - v_{xx} = e^{-t} - {2x \over \pi }\left(1 + e^{-t}\right).$$
with a new boundary condition:

$$v(x,0) = \cos(3x) - 1 + {2x \over \pi}.$$

I then set $v(x,t) = \sum_{n=1}^\infty c(n,t)\sin(2\,x n)$, which I understand now satisfies the new homogeneous boundary conditions. Differentiating $v(x,t)$:

\begin{align} v_t &= \sum_{n=1}^\infty c_t(n,t)\sin(2x n),\\ v_{xx} &= -\sum_{n=1}^\infty c(n,t)4s^2\sin(2x n), \end{align}

and substituting into the new equation gives:

$$\sum_{n=1}^\infty c_t(n,t)\sin(2x n) + \sum_{n=1}^\infty c(n,t)2n^2\sin(2x n) = e^{-t} - {2x \over \pi }\left(1 + e^{-t}\right).$$

How do I find these coefficients $c(n,t)$?

EditPiAf
  • 21,328
dwcecil
  • 125

2 Answers2

16

Let's back up a little bit and provide a comprehensive answer to these types of problems.

Suppose $u(x,t)$ solves \begin{align} u_t&=u_{xx}, \qquad 0 < x < \ell,\ t>0,\\ u(0,t)&=f(t),\\ u(\ell, t)&=g(t),\\ u(x,0)&=h(x). \end{align} In the subsequent work, we will impose whatever smoothness conditions on the initial and boundary data we need to get convergence of the involved series.

First, standard separation of variables shows that the solution to the problem with homogeneous BCs is $$u(x,t)=\sum_{n=1}^\infty b_n\sin(\sqrt{\lambda_n}\,x)e^{-\lambda_n t},$$ where $\lambda_n=(n\pi/\ell)^2$, $n=1,2,\dots$ In other words, for each fixed $t>0$, $$u(x,t)=\sum_{n=1}^\infty u_n(t)\sin(\sqrt{\lambda_n}\,x)\quad\text{where}\quad u_n(t)={2\over \ell}\int_0^\ell u(x,t)\sin(\sqrt{\lambda_n}\,x)\,dx.$$ (This is a key observation. I hope the notation isn't confusing: $u_n$ represents the coefficients in the series for $u$, not a partial derivative.)

Then, differentiating the series above, define $v_n(t)$ and $w_n(t)$ as the coefficients in the series for ${\partial u\over \partial t}$ and ${\partial^2 u\over \partial x^2}$, respectively:

\begin{align} {\partial u\over \partial t}&=\sum_{n=1}^\infty v_n(t)\sin(\sqrt{\lambda_n}\,x) \quad\text{where}\quad v_n={2\over \ell}\int_0^\ell {\partial u\over \partial t}\sin(\sqrt{\lambda_n}\,x)\,dx={du_n\over dt},\\ {\partial^2 u\over \partial x^2}&=\sum_{n=1}^\infty w_n(t)\sin(\sqrt{\lambda_n}\,x) \quad\text{where}\quad w_n={2\over \ell}\int_0^\ell {\partial^2 u\over \partial x^2}\sin(\sqrt{\lambda_n}\,x)\,dx. \end{align}

Integrating the $w_n(t)$ by parts, simplifying the trig terms, and applying the BCs, we get \begin{align} w_n(t)&=-{2\over \ell}\int_0^{\ell} \lambda_n u(x,t)\sin(\sqrt{\lambda_n}\,x)\,dx\\ &\qquad\qquad+{2\over \ell}\left[u_x(x,t)\sin(\sqrt{\lambda_n}\,x)-\sqrt{\lambda_n}\,u(x,t)\cos(\sqrt{\lambda_n}\,x)\right]\Bigg|_{x=0}^{x=\ell}\\ &=-\lambda_nu_n(t)+\underbrace{{2\sqrt{\lambda_n}\over \ell}\left[f(t)+(-1)^{n+1}g(t)\right]}_{F(t)}. \end{align}

From the PDE, $$u_t=u_{xx}\implies v_n(t)=w_n(t)\implies {du_n\over dt}=-\lambda_n u_n(t)+F(t),$$ and thus the coefficients $u_n(t)$ we seek are found by solving the (ODE!) initial-value problem \begin{align} {du_n\over dt}+\lambda_nu_n(t)&=F(t),\\ u_n(0)&={2\over \ell}\int_0^\ell h(x)\sin(\sqrt{\lambda_n}\,x)\,dx, \end{align} by the method of your choice.

This is called the method of eigenfunction expansions. Transform methods are also available, but that is a separate post.

Hope that helps.

Alex M.
  • 35,927
JohnD
  • 14,681
  • Thanks for your answer. On your first equation, $h$ is a function of position $x$ I guess, not time $t$. – FraSchelle Feb 19 '14 at 21:49
  • 2
    Can someone explain why solving the associated problem with homogeneous BCs is relevant? Why does this give us the eigenfunctions we need? It seems to me that assuming a solution of the form $u(x,t) = \sum_{n} u_n(t)\sin(\sqrt{\lambda_n}x)$ is what we don't want because then $u(0,t) = 0 \neq f(t)$ and $u(\ell, t) = 0 \neq g(t)$. What am I not understanding? – whippedcream Dec 11 '17 at 05:50
  • In case the problem is formulated on the half line $x\in[0,\infty)$ the sum over $n$ for $u(x,t)$ can be done, see e.g.: https://www.sciencedirect.com/science/article/pii/S0898122100003138 – Andras Vanyolos Mar 13 '19 at 21:26
  • I am having some trouble understanding the solution. If we solve $u_n$, do we substitute it in $u(x,t)=\Sigma_{n=1}^{\inf} u_n(t) sin(\sqrt{\lambda}x)$? But then $u(x=0,t)$ is always 0 and not $f(t)$ – Yuki.kuroshita Oct 18 '21 at 21:19
  • Your solution is not quite right. You right $u_n = u_n(t)$, not $u_n = u_n(t,x)$. Further, I believe that the statement of $u_n$ should not include the variable $x$. Rather, $$ u_n = u_n(t) = \frac{2}{\ell}\int_0^\ell u(z,t),\sin(\sqrt{\lambda_n},z),dz. $$ In such case $$ \frac{\partial^2 u(x,t)}{\partial x^2} = \sum_{n=1}^\infty u_n(t), \frac{\partial^2 \sin(\sqrt{\lambda_n},t)}{\partial x^2} . $$ How, if at all, does this change your analysis? – Michael Levy Mar 28 '22 at 03:02
  • I am completely confused by your answer as well. How can you take Fourier series for the derivatives? You need to know that these functions are periodic. Furthermore, $g(t) = f(t)$ in this case, assuming again that $u(x,t)$ is periodic. – qp212223 Dec 21 '23 at 01:44
1

I would like to suggest another way to solve this problem starting from: $$v_t-v_{xx}=f(x,t).$$

For the sake of simplicity, notations are close to the ones used in the previous answer.

One may use the Duhamel's Principle [Duhamel][1] by considering a homogeneous problem with the following initial condition: $$v_t-v_{xx}=0\\ v(x,s)=f(x,s).$$

The solution of the homogeneous problem may be written: $$ v(x,t;s)=\sum_{n=1}^{\infty}b_n(s)\sin{(\sqrt{\lambda_n}x)}\exp{(-\lambda_n(t-s))},$$

considering: $$b_n(s)=\frac{2}{\pi/2}\int_0^{\pi/2}f(x,s)\sin{(\sqrt{\lambda_n}x)}dx.$$

By application of the Duhamel's Principle, the solution of the inhomogeneous problem is: $$v(x,t)=\sum_{n=1}^{\infty}\sin{(\sqrt{\lambda_n}x)}\int_0^tb_n(s)\exp{(-\lambda_n(t-s))}ds.$$

Some useful examples for the heat equation are given here [2].

I hope this can help.

[1] https://en.wikipedia.org/wiki/Duhamel%27s_principle

[2] https://people.math.gatech.edu/~xchen/teach/pde/heat/Heat-Duhamel.pdf

bou
  • 31