Question: Find the solution of the heat conduction problem

$$ \begin{cases} U_{xx} =4U_t , 0 < x < 2, t>0\\ U(0,t)=0, U(2,t)=0, t>0\\ U(x,0)=2\sin(\frac\pi2x)-\sin(\pi x) + 4\sin(3\pi x), 0 \le x \le 2 \end{cases} $$

My Attempt: I managed to replace the PDE to a pair of ODE using separation of variables $u(x,t)=X(x)T(t)$ and constant $\lambda$.

$$ X''T=4XT'\\ \frac {X''}{X} = \frac{4T'}{T}\\ X'' + \lambda X=0\\ T' + T\frac{ \lambda}{4} = 0 $$

But I don't really understand how I should continue from here using the given conditions? Does anyone have any tips or solutions?


1 Answer 1


You are correct to use separation of variables to break up the Partial Differential Equation (PDE) into two independent Ordinary Differential Equations (ODEs). The next step is to solve these equations, then we will find the constants.

First, you should use $ \frac {X''}{X} = \frac{4T'}{T} = - \lambda^2$ as this gives you a negative only eigenvalue. We want negative because we cannot match the boundary conditions with a zero or positive eigenvalue (check the case of $0$ to convince yourself of this, the proof for $\lambda^2$ shown below). You do in general need to check these possibilities, but for this PDE with these boundary conditions the eigenvalues are strictly negative. This will give us a non-zero imaginary number in the ODE solving for $X$.

The independent ODEs are

$ X'' = - \lambda^2 X$


$T'= - \frac 14\lambda^2T$

This will give you the following,

$X(x) = A\sin( \lambda x)+B\cos( \lambda x)$

$T(t) = Ce^{\frac {-\lambda^2 t} 4}$

After which you plug in your boundaries of $U(0,t)=0$, $U(2,t)=0$ giving you

$X(0) = A\sin(0)+B\cos(0) = B =0$

And $X(2) = A\sin( 2\lambda ) = 0$ (already removed $B$)

From the second equation we can see that $\lambda$ must be a multiple of $\frac \pi 2$, in fact any integer multiple of $\frac \pi 2$ must be considered. You have a countably infinite number of solutions since every single integer multiple is a valid answer for the question, we will denote these solutions $X_n(x)=C_n \sin(n\frac\pi2x)$ with $\lambda_n =n\frac\pi2$. Since this is a linear differential equation we know the linear combination of solutions is also a solution so we must sum up all possible answers.

By summing all possible solutions together, and multiplying the $T(t)$ term back in we get

$U(x,t) = \sum_{n=1}^\infty T_n(t)X_n(x)$ (remember, $T(t)$ is also a function of $\lambda_n$) Which we simplify to

$U(x,t) = \sum_{n=1}^\infty C_ne^{\frac {-\pi^2 n^2t} {16}}\sin(n\frac\pi2x)$

This is the general form of the answer, all that is left is determining the constants.

In order to do this, we will use Fourier's trick (see link for more details) which uses the initial condition $U(x,0)=2\sin(\frac\pi2x)-\sin(\pi x) + 4\sin(3\pi x)$ and boundary $ 0 \le x \le 2$ to find our undetermined constants.

First we find $U(x,0)$ given our formula as $U(x,0) = \sum_{n=1}^\infty C_n \sin(n\frac\pi2x)$ because $e^0=1$

we then set this equal to $2\sin(\frac\pi2x)-\sin(\pi x) + 4\sin(3\pi x)$ on the boundary $ 0 \le x \le 2$ which we know from the boundary conditions.

$U(x,0) = \sum_{n=1}^\infty C_n \sin(n\frac\pi2x) = 2\sin(\frac\pi2x)-\sin(\pi x) + 4\sin(3\pi x)$

This is where the trick comes in. We will first multiply both sides by $\sin (n'\frac\pi2x)$ where $n'$ is an integer. After that, we integrate in $x$ over the boundary $ 0 \le x \le 2$

This gives us \begin{align} &\sum_{n=1}^\infty C_n \int_0^2 \sin( n\frac\pi2x)\sin (n'\frac\pi2x) dx = \\ &\qquad=\int_0^2 2\sin(\frac\pi2x)\sin (n'\frac\pi2x)-\sin(\pi x)\sin (n'\frac\pi2x) + 4\sin(3\pi x)\sin (n'\frac\pi2x) dx \end{align} (notice we pulled the summation out of the integral)

We will take advantage of the following property.

if $n = n'$ then $\int_0^2 \sin( n\frac\pi2x)\sin (n'\frac\pi2x) dx = \frac 2 2 = 1$

if $n \neq n'$ then $\int_0^2 \sin(n\frac\pi2x)\sin (n'\frac\pi2x) dx = 0$

in essence $\int_0^2 \sin(n\frac\pi2x)\sin (n'\frac\pi2x) dx = \begin{cases} 1, & n = n' \\ 0, & n \neq n'\end{cases}$

Therefore \begin{align} &\sum_{n=1}^\infty C_n \int_0^2 \sin( n\pi x )\sin (n' \pi x) dx =\\ &\qquad=C_{n} = \int_0^2 2\sin(\frac\pi2x)\sin (n\frac\pi2x)-\sin(\pi x)\sin (n\frac\pi2x) + 4\sin(3\pi x)\sin (n\frac\pi2x) dx \end{align}

giving us

$C_{n} = \int_0^2 2\sin(\frac\pi2x)\sin (n\frac\pi2x) dx -\int_0^2 \sin(\pi x)\sin (n\frac\pi2x)dx + 4\int_0^2\sin(3\pi x)\sin (n\frac\pi2x) dx = \int_0^2 2\sin((1)\frac\pi2x)\sin (n\frac\pi2x) dx -\int_0^2 \sin((2)\frac\pi2x)\sin (n\frac\pi2x)dx + 4\int_0^2\sin((6)\frac\pi2x)\sin (n\frac\pi2x) dx $

(Can you see why the sum drops out? Hint: the sum runs through the entire index of integers, but if $n$ and $n'$ are not equal then the integral is $0$)

Simplifying to $C_{n} = \begin{cases} 2, & n = 1 \\ 0, & n \neq 1\end{cases} +\begin{cases} -1, & n = 2 \\ 0, & n \neq 2\end{cases} + \begin{cases} 4, & n = 6 \\ 0, & n \neq 6\end{cases} $

We actually have a finite number of terms in the sum that are not $0$, using $U(x,t) = \sum_{n=1}^\infty C_ne^{\frac {-\pi^2 n^2t} {16}}\sin(n\frac\pi2x)$, and plugging in those constants.

$U(x,t) = 2e^{\frac {-\pi^2 1^2t} {16}}\sin(1\frac\pi2x)-e^{\frac {-\pi^2 2^2t} {16}}\sin(2\frac\pi2x)+4e^{\frac {-\pi^2 6^2t} {16}}\sin(6\frac\pi2x)$

Which simplifies to

$U(x,t) = 2e^{\frac {-\pi^2t} {16}}\sin(\frac\pi2x)-e^{\frac {-\pi^2t} {4}}\sin(\pi x)+4e^{\frac {-9\pi^2 t} {4}}\sin(3\pi x)$

Graph of heat equation

Here is the graph, which I plotted between $x=0$ and $x=2$ with $t$ ranging from $0$ to $1$. you can see that near $t=0$ there are strong fluctuations in $x$ which quickly smooth out. The physical representation of this is large temperature gradients which would come into thermal equilibrium as heat flows using thermodynamic laws (well, as much as a system with two points that are held at temperature zero can be called a thermodynamic system). Eventually the function would be zero across the entire boundary as the limit of time tends to infinity.

Edit Attaching the determination that our independent ODEs cannot equal $\lambda^2$ (I.E. any positive number)

Now are equations are

$ X'' = \lambda^2 X$

$T'= \frac 14\lambda^2T$

giving us

$X(x) = Ae^{ \sqrt\lambda x}$

$T(t) = Ce^{\frac {\lambda^2 t} 4}$

Let us try to apply our boundary conditions of $U(0,t)=0$, $U(2,t)=0$ into $X(x)$

$U(0,t)= Ae^0 = A = 0$

This shows that the constant $A$ must be $0$ so no equations of this form are included. If more than one case, for example positive and negative eigenvalues, are valid you must sum them together with their respective constants, complicating the problem.

  • $\begingroup$ At that point we found that $\lambda$ is an integer multiple of $\pi$. Every single integer multiple is a valid answer for the question. What I am saying is you have an infinite number of solutions. Since this is a linear differential equation we know the linear combination of solutions is also a solution. So I summed up every possible solution and gave them their own constants. $\endgroup$
    – kleineg
    May 20, 2015 at 14:11
  • $\begingroup$ It is like the solution to the ordinary differential equation in $x$, where we find $X(x) = C_1sin( \lambda x)+C_2cos( \lambda x)$, the sine and cosine terms are both valid solutions, so because it is a linear problem we sum them together. $\endgroup$
    – kleineg
    May 20, 2015 at 14:13
  • $\begingroup$ The constants for each valid solution will be different. That is what we use Fourier's trick for, to find the constants given the initial condition. $\endgroup$
    – kleineg
    May 20, 2015 at 14:17
  • $\begingroup$ The exponential we found was the function $T(t)$ which was in the fourth block of text. You have to multiply $X(x)$ and $T(t)$ back together. $\endgroup$
    – kleineg
    May 20, 2015 at 14:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .