# How to Treat Coefficient as Constant To Approximately Solve PDE?

I am interested in analytically deriving an approximate solution to $\frac{\partial}{\partial t}f(x,t)=c(x,t) \frac{\partial}{\partial x^2}f(x,t)$ subject to given initial and boundary conditions. If the coefficient $c(x,t)$ was constant, then I knew how to obtain the solution of the equation exactly. Now that $c(x,t)$ varies in both $x$ and $t$, I do not have an analytical form, but still probably my best tool is to treat $c(x,t)$ as a constant $c$. I can think of two strategies for doing that, and I want to know which one makes more sense to you.

1. Literally replacing $c(x,t)$ by a constant, e.g. by its average value across $x \in \mathbb{R}$ and $t \geq 0$.
2. Treating $c(x,t)$ as a constant $c$ when solving the PDE. Once the solution is obtained, the we replace $c$ with $c(x,t)$ in the solution form.

Idea #2 is a bit crazy, but the actual $c(x,t)$ is not even nearly a constant in my problem, so I am worried that idea #1 completely misrepresents the problem. I appreciate opinions about which one of the two ideas may lead to a higher quality approximate solution and what is the justification for that.

Thanks

Golabi

I am no expert, and perhaps there is an easy way to obtain the analytical solution... if one makes the variable change $w(\eta(x,t)) = u(x,t)$ with $\eta(x,t) = \frac{x}{\sqrt{t}},$ the equation becomes $$w''(\eta) - \frac{\eta}{C(\eta)} w'(\eta) = 0,$$ which can then be directly integrated using an integrating factor, and then integrated directly again. Note that $C(\eta) = c(x,t)$ and I have assumed that $c \neq 0$ in order to divide by it. If $C(\eta)$ is a "nice" function, you'll be able to get the explicit form of the solution.

As for just solving the heat equation and plugging in $c(x,t)$ at the end... I'd say keep dreaming. Replacing $c(x,t)$ by some sort of average... I'd say its highly unlikely that doing either of these will capture the approximate nature of the actual solution.

One way, which is likely more difficult than just solving the equation numerically or analytically, could be to specify a grid of squares (boxes) over your domain, then treat $c$ as a constant (say, the average) over each of those boxes. As you refine the grid size, I suppose you may get a reasonable approximation. But even this is likely to result in discontinuities between boxes, which is qualitatively not what the heat equation does.

Edit: Consider the problem where $c = 1$ and $u_t = u_{xx}$ on $|x| < \infty, t > 0$ with the initial condition $u(x,0) = H(x),$ the heaviside function. If one does the transform above, one ultimately concludes that the solution to this problem is $$u(x,t) = \frac{1}{2}\bigg(1 + erf\big(\frac{x}{2\sqrt{t}}\big)\bigg).$$ Upon differentiating, one sees that $u_x(x,t) = \frac{1}{\sqrt{4\pi t}} e^{-x^2/4t}.$ One may recognize that as $t \to 0,$ this function becomes a better and better approximation to the delta function. This motivates saying that perhaps the solution to the problem $$u_t = u_{xx}; \; u(x,0) = \delta(x); \; |x| < \infty, t>0$$ is in fact $u(x,t) = \frac{1}{\sqrt{4\pi t}} e^{-x^2/4t}.$ Recall that this indeed is the fundamental solution to the heat equation, or the heat kernel, infinite domain Green's function, what have you.

This is a lot to do but for what purpose? Well, now consider solving $$u_t = c(x,t)u_{xx}; \; u(x,0) = H(x); \; |x| < \infty, t>0.$$ Following along the steps outlined originally, one might be able to get a nice analytic solution to this problem for nice $c(x,t),$ and then maybe by differentiating this analytic solution, one will obtain the solution to $$u_t = c(x,t)u_{xx}; \; u(x,0) = \delta(x); \; |x| < \infty, t>0.$$

There are some serious details being left out in that final step, but hey, its a possibility.

• Please correct me if I am wrong, but your idea seems to give a limited solution only (cannot satisfy my initial condition). Take $c(x,t)=1$ and thus $\frac{\partial}{\partial t}f(x,t)=\frac{\partial^2}{\partial x^2}f(x,t)$. Let $w(\eta(x,t))=f(x,t)$ with $\eta=x^2/t$.Thus $-\frac{x^2}{t^2}w'(\frac{x^2}{t})=\frac{2}{t^2}(2t w'(x^2/t)+4x^2 w''(x^2/t))$. Eliminating $t$ using $\eta=\frac{x^2}{t}$ gives $\eta((\eta+2)w'(\eta)+4\eta w''(\eta)$ whose solution is $a\,erf(\sqrt{\eta}/2)$, i.e. $a\,erf(\frac{x}{2\sqrt{t}})$. When $t \rightarrow 0$, the only admissible initial condition is $a\,sign(x)$. – Golabi Feb 24 '17 at 19:41
• To be concrete, my initial condition is the Dirac delta function: $f(x,t=0)=\delta(x-x_0)$. – Golabi Feb 24 '17 at 21:07
• Consider adding boundary conditions and initial conditions to your original statement. This way, you'll get answers more tailored towards your problem. Either way, I will add a little to my answer which may or may not be of interest to you. – Merkh Feb 25 '17 at 0:18
• Thanks a lot. Initial condition is the delta function $f(x,t=0)=\delta(x-x_0)$ and boundary conditions are $f(x=\pm L,t)=0$. Solving either case of bounded or unbounded domain ($L=1$ or $L=\infty$) is helpful. – Golabi Feb 25 '17 at 0:23
• Thank you for the update! Very helpful. – Golabi Feb 25 '17 at 1:02