# How to find analytical solution for this linear PDE?

Find $$u(x)$$ in the interval $$x \in(0, l)$$ such that \begin{aligned} a \frac{\mathrm{d} u}{\mathrm{~d} x}-\kappa \frac{\mathrm{d}^2 u}{\mathrm{~d} x^2} & =f(x), \quad x \in(0, \ell) \\ u(0) & =0 \\ u(\ell) & =1 \end{aligned} where $$a$$ denotes the advective velocity, $$\kappa$$ is the diffusion coefficient while $$f(x)$$ is the source.

The solution to this for $$f \equiv 0$$ can be analytically written as $$u(x)=\frac{1-\exp (a x / \kappa)}{1-\exp (a \ell / \kappa)}$$ where $$a \ell / \kappa$$ is known as the Peclet number $$(\mathrm{Pe})$$ and measures the ratio of the strength of advection to the strength of diffusion.

Can one explain how analytical solution is coming as $$\boxed{ u(x)=\frac{1-\exp (a x / \kappa)}{1-\exp (a \ell / \kappa)}}$$

• Just check. ___ Commented Apr 24, 2023 at 5:03
• Commented Apr 24, 2023 at 5:09

If $$f\equiv 0$$, the ODE reduces to $$au'-\kappa u''=0. \tag{1}$$ Integrating $$(1)$$, we obtain $$au-\kappa u'=C_1. \tag{2}$$ Rearranging terms, we can rewrite $$(2)$$ as $$\frac{\kappa u'}{au-C_1}=1. \tag{3}$$ Integrating both sides of $$(3)$$ with respect to $$x$$ we obtain $$\frac{\kappa}{a}\ln|au-C_1| = x+C_2 \Rightarrow u(x)=C_1'+C_2'e^{ax/\kappa}, \tag{4}$$ where $$C_1'$$ and $$C_2'$$ are arbitrary constants. To determine them, we use the boundary conditions: \begin{align} u(0)=0&\Rightarrow C_1'+ C_2' = 0, \\ u(\ell)=1&\Rightarrow C_1'+ C_2'e^{a\ell/\kappa} = 1. \tag{5} \end{align} Solving $$(5)$$ we obtain $$C_1'=-C_2'=-\frac{1}{e^{a\ell/\kappa}-1} \tag{6}$$ and, finally, $$u(x)=\frac{e^{ax/\kappa}-1}{e^{a\ell/\kappa}-1}. \tag{7}$$
Hint: the solution can be written as $$$$u(x) = \alpha + \beta e^{\frac{a}{k}x}+ \int_0^\ell \varphi(x-t)f(t)dt$$$$ where $$\varphi(x)$$ is the fundamental solution $$$$\varphi(x) = \left\{ \begin{array} \\-\frac{1}{a}\quad\text{if}\quad x<0\\ -\frac{1}{a}e^{\frac{a}{k}x}\quad\text{if}\quad x>0 \end{array} \right.$$$$ and $$\alpha, \beta$$ are suitable constants depending on $$f$$.
• This is detailed enough. You can determine $\alpha$ and $\beta$ by writing $u(0)$ and $u(\ell)$. Commented Apr 24, 2023 at 6:02