# Solving partial differential equation using laplace transform with time and space variation

I have a equation like this:

$\dfrac{\partial y}{\partial t} = -A\dfrac{\partial y}{\partial x}+ B \dfrac{\partial^2y}{\partial x^2}$

with the following I.C
$y(x,0)=0$

and boundary conditions $y(0,t)=1$ and $y(\infty , t)=0$

I tried to solve the problem as follows: Taking Laplace transform on both sides,

$\mathcal{L}(\dfrac{\partial y}{\partial t}) = - A \mathcal{L}(\dfrac{\partial y}{\partial x})+B \mathcal{L}(\dfrac{\partial^2 y}{\partial x^2})$

Now, on the L.H.S we have, $sY-y(x,0)=sY$

$\mathcal{L}(\dfrac{\partial^2 y}{\partial x^2}) =\displaystyle \int e^{-st} \dfrac{\partial^2 y}{\partial x^2} dt$

Exchanging the order of integration and differentiation

$\displaystyle\mathcal{L}(\frac{\partial^2 y}{\partial x^2}) =\frac{\partial^2}{\partial x^2} \int e^{-st} y(x,t) dt$

$\displaystyle\mathcal{L}(\frac{\partial^2 y}{\partial x^2}) =\frac{\partial^2}{\partial x^2}\mathcal{L}(y) = \frac{\partial^2Y}{\partial x^2}$

$\displaystyle\mathcal{L}\frac{\partial y}{\partial x} = \frac{\partial Y}{\partial x}$

Now, combing L.H.S and R.H.S, we have,

$\displaystyle sY = - A \frac{\partial Y}{\partial x} + B \frac{\partial^2Y}{\partial x^2}$

Above equation might have three solutions:

If $b^2 - 4ac > 0$ let $r_1=\frac{-b-\sqrt{b^2-4ac}}{2a}$ and $r_2 = \frac{-b+\sqrt{b^2-4ac}}{2a}$

The general solution is $\displaystyle y(x) = C_1e^{r_1x}+C_2 e^{r_2x}$

if $b^2 - 4ac = 0$, then the general solution is given by

$y(x)=C_1e^{-\frac{bx}{2a}}+C_2xe^-{\frac{bx}{2a}}$

if $b^2 - 4ac <0$ , then the general solution is given by

$y(x) = C_1e^{\frac{-bx}{2a}}\cos(wx) + C_2 e^{\frac{-bx}{2a}}\sin(wx)$

Since, A, and B are always positive in my problem, the first solution seems to be appropriate.

Now, from this point I am stuck and couldn't properly use the boundary conditions.

If anyone could offer any help that would be great.

"Solution added" The solution of the problem is

$y(x,t)= \dfrac {y_0}{2} [exp(\dfrac {Ax}{B}erfc(\dfrac{x+At}{2\sqrt{Bt}}) + erfc(\dfrac{x-At}{2\sqrt{Bt}})$

## 2 Answers

Using your notation, we have

$$B Y''(x,s) - A Y'(x,s) - s Y(x,s) = 0$$

$$Y(0,s)=\int_0^{\infty} dt\: 1 \cdot e^{-s t} = \frac{1}{s}$$

$$\lim_{x \rightarrow \infty} Y(x,s) = 0$$

The general solution to the equation is

$$Y(x,s) = M(s) e^{r_+ x} + N(s) e^{r_- x}$$

where

$$r_{\pm} = \frac{A \pm \sqrt{A^2+ 4 B s}}{2 B}$$

where

$$M(s) + N(s) = \frac{1}{s}$$

$$M(s)=0$$

The latter equation was determined by the limit at $\infty$. (I am of course assuming that $B > 0$; the other case may be considered as well.)

Therefore

$$Y(x,s) = \frac{1}{s} \exp{\left[-\frac{\sqrt{A^2+4 B s}-A}{2 B} x \right ]}$$

It is this quantity that must be inverse LT'ed to get the solution to your equation, viz.

$$y(x,t) = \frac{1}{i 2 \pi} \int_{c-i \infty}^{c+i \infty} ds \: \frac{1}{s} \exp{\left[-\frac{\sqrt{A^2+4 B s}-A}{2 B} x + s \, t\right ]}$$

• Hi Ron Gordon, thank you so much for your answer. The solution of the problem is $y(x,t)= \dfrac {y_0}{2} [exp(\dfrac {Ax}{B}erfc(\dfrac{x+At}{2\sqrt{Bt}}) + erfc(\dfrac{x-At}{2\sqrt{Bt}})$ I didn't understand the last equation in your solution. Could you please explain that little bit ? – Jdbaba Mar 24 '13 at 18:48
• The last equation is the equation for the inverse Laplace transform - what you need to derive from the LT'ed solution. See en.wikipedia.org/wiki/Inverse_Laplace_transform – Ron Gordon Mar 24 '13 at 18:49
• @ Ron, thank you for explaining things so nicely. But I am stuck solving this complex integral also. Can you please help me solve this integral by any suggestion ? Thanks. – Jdbaba Mar 24 '13 at 19:26
• OK, just remember that we will solve (or try) the problem you post, so hopefully you can translate what I wrote into the initial condition you meant. BTW my pleasure posting this solution, I love this stuff. I am still looking for that ILT. – Ron Gordon Mar 24 '13 at 20:05
• @Jdbaba: not yet; an exhaustive search of the literature has not turned up anything yet. Really trying to figure out how to evaluate the integral myself at this point. Not easy, I'm going to have to ask you to hang on...it may be a few days. – Ron Gordon Mar 25 '13 at 0:27

I get a simpler procedure that without using laplace transform.

Note that this PDE is separable.

Let $y(x,t)=X(x)T(t)$ ,

Then $X(x)T'(t)=-AX'(x)T(t)+BX''(x)T(t)$

$X(x)T'(t)=(BX''(x)-AX'(x))T(t)$

$\dfrac{T'(t)}{T(t)}=\dfrac{BX''(x)-AX'(x)}{X(x)}=\dfrac{4B^2s^2-A^2}{4B}$

$\begin{cases}\dfrac{T'(t)}{T(t)}=\dfrac{4B^2s^2-A^2}{4B}\\BX''(x)-AX'(x)-\dfrac{4B^2s^2-A^2}{4B}X(x)=0\end{cases}$

$\begin{cases}T(t)=c_3(s)e^\frac{t(4B^2s^2-A^2)}{4B}\\F(x)=\begin{cases}c_1(s)e^\frac{Ax}{2B}\sinh xs+c_2(s)e^\frac{Ax}{2B}\cosh xs&\text{when}~s\neq0\\c_1xe^\frac{Ax}{2B}+c_2e^\frac{Ax}{2B}&\text{when}~s=0\end{cases}\end{cases}$

$\therefore y(x,t)=\int_{-\infty}^\infty C_1(s)e^\frac{2Ax+t(4B^2s^2-A^2)}{4B}\sinh xs~ds+\int_{-\infty}^\infty C_2(s)e^\frac{2Ax+t(4B^2s^2-A^2)}{4B}\cosh xs~ds$

$y(0,t)=1$ :

$\int_{-\infty}^\infty C_2(s)e^\frac{t(4B^2s^2-A^2)}{4B}~ds=1$

$C_2(s)=\dfrac{1}{2}\left(\delta\left(s-\dfrac{A}{2B}\right)+\delta\left(s+\dfrac{A}{2B}\right)\right)$

$\therefore y(x,t)=\int_{-\infty}^\infty C_1(s)e^\frac{2Ax+t(4B^2s^2-A^2)}{4B}\sinh xs~ds+\int_{-\infty}^\infty\dfrac{1}{2}\left(\delta\left(s-\dfrac{A}{2B}\right)+\delta\left(s+\dfrac{A}{2B}\right)\right)e^\frac{2Ax+t(4B^2s^2-A^2)}{4B}\cosh xs~ds=\int_{-\infty}^\infty C_1(s)e^\frac{2Ax+t(4B^2s^2-A^2)}{4B}\sinh xs~ds+e^\frac{Ax}{2B}\cosh\dfrac{Ax}{2B}$