Solving PDE using separation of variables (Heat diffusion)

boundary value problemhomogeneous equationpartial differential equations

I am trying to solve a standard PDE, but I got stuck on how to choose the separation constant such that I do not end up with a trivial, uninteresting solution. The system is presented below and my solution thus far.

$\left\{\begin{array}{ll}u_{t}(x,t)-\alpha u_{xx}(x,t)=C,\quad 0<x<L,\quad t>0\\u_{x}(0,t)=0,\quad u(L,t)=0,\quad t>0\\u(x,0)=0,\quad 0<x<L\end{array}\right.$

I begin by defining $w(x)$ so that it satisfies the following equation $\alpha w''(x)+C=0$ (this will turn the problem into a homogenous system by setting $u(x,t)=v(x,t)+w(x)$, where $v(x,t)$ is another function I define). The solution to the ODE above is $w(x)=\frac{C}{2\alpha}(L^2-x^2)$, using the boundary conditions above. Now, the new homogeneous system becomes:

$\left\{\begin{array}{ll}v_{t}(x,t)-\alpha v_{xx}(x,t)=0,\quad 0<x<L,\quad t>0\\v_{x}(0,t)=0,\quad v(L,t)=0,\quad t>0\\v(x,0)=\frac{C}{2\alpha}(x^2-L^2),\quad 0<x<L\end{array}\right.$

I use separation of variables: $v(x,t)=X(x)T(t)$. The first equation becomes $XT'=\alpha X''T\implies \alpha \frac{X''}{X}=\frac{T'}{T}=-\lambda$, where $\lambda$ is a separation constant. This results in the system

$\left\{\begin{array}{ll}\alpha X''+\lambda X=0\\T'+\lambda T=0\\\end{array}\right.$

We know that for $\lambda \leq 0$ only trivial solutions are obtained, so we set $0<\lambda$. The ODEs yield the following solutions:

$\left\{\begin{array}{ll}X(x)=A \cos(\sqrt{\lambda /\alpha }x)+B\sin(\sqrt{\lambda / \alpha}x)\\T(t)=De^{-\lambda t}\\\end{array}\right.$

Now, when I apply the BCs I get $A=0$ and if $B\neq 0$ then $\lambda =\frac{\alpha}{L^2}(\pi /2 +\pi n)$, where $n$ is a non-negative integer.

Is that correct? Do I just multiply $X$ and $T$ and sum up all these solutions for different $n$ using linearity and that is my (general) solution? It looks odd to me.

Best regards //

Best Answer

The eigenvalues look "odd" because you have mixed boundary conditions (Neumann on one side, Dirichlet on the other).

Note that the B.C. $X'(0) = 0$ forces $\color{red}{B=0}$, so the eigenfunctions have the form

$$ X_n(x) = \cos\left(\frac{(2n+1)\pi}{2L}x\right) $$

where $n = 0,1,2,\dots$ and $\lambda_n = \dfrac{\alpha\pi^2}{4L^2}(2n+1)^2$

The rest is business as usual. Write the general solution as a series and use the I.C. $u(x,0)$ to find the constants.

Edit: The solution is

$$ v(x,t) = \sum_{n=0}^\infty c_n e^{-\frac{\alpha \pi^2}{4L^2}(2n+1)^2t}\cos\left(\frac{(2n+1)\pi}{2L}x\right) $$

where

$$ c_n = \frac{\int_0^L f(x)\cos\left(\frac{(2n+1)\pi}{2L}x\right) dx}{\int_0^L \cos^2\left(\frac{(2n+1)\pi}{2L}x\right)dx } $$

and $f(x) = v(x,0)$

Edit 2: This result was derived from the orthogonality of the eigenfunctions. For $n\ne m$ you always have

$$ \int_0^L X_n(x)X_m(x)\ dx = 0 $$

To find $c_n$ such that

$$ \sum_{n=0}^\infty c_n X_n(x) = f(x) $$

Multiply both sides by $X_m(x)$ and integrate throughout

$$ \sum_{n=0}^\infty c_n\int_0^L X_n(x)X_m(x)\ dx = \int_0^L f(x)X_m(x)\ dx $$

Every term on the LHS will go to $0$ except for when $n=m$, therefore

$$ c_m \int_0^L [X_m(x)]^2\ dx = \int_0^L f(x) X_m(x)\ dx $$