# Differentiate $e^{-\frac{x^2}{4Dt}}$

How to differentiate $$\exp \left( -\frac{x^2}{4Dt} \right)$$ ?

(A step by step solution is sought)

-
I see that this is related to your previous question where both $x$ and $t$ are variables. So do you want to differentiate with respect to $t$ or $x$ or both? – Srivatsan Nov 21 '11 at 17:06
@Srivatsan I wanted to differentiate $P$ with respect to $t$ for the LHS of the equation in the previous question, then $P$ with respect to $x$ twice for the RHS. – ptrcao Nov 22 '11 at 4:37

Make the simple substitution $u=-\frac{x^2}{4Dt}=-\frac{1}{4}x^2D^{-1}t^{-1}$ and let $z=\mathrm{exp}(u)$. Then...

$$\frac{\partial z}{\partial x} = \frac{dz}{du}\frac{\partial u}{\partial x} = \mathrm{exp}(u) \cdot \left(-\frac{1}{2}xD^{-1}t^{-1} \right) = -\frac{x\cdot \mathrm{exp}\left(-\frac{x^2}{4Dt}\right)}{2Dt}$$

$$\frac{\partial z}{\partial t} = \frac{dz}{du}\frac{\partial u}{\partial t} = \mathrm{exp}(u) \cdot \left(\frac{1}{4}x^2D^{-1}t^{-2} \right) = \frac{x^2\cdot \mathrm{exp}\left(-\frac{x^2}{4Dt}\right)}{4Dt^2}$$

If $D$ is meant to be a variable, we'd also have...

$$\frac{\partial z}{\partial D} = \frac{dz}{du}\frac{\partial u}{\partial D} = \mathrm{exp}(u) \cdot \left(\frac{1}{4}x^2D^{-2}t^{-1} \right) = \frac{x^2\cdot \mathrm{exp}\left(-\frac{x^2}{4Dt}\right)}{4D^2t}$$

Now what if $D$ is constant, $x$ is a function of $t$? Then we have...

$$\frac{dz}{dt} = \frac{dz}{du}\frac{\partial u}{\partial x}\frac{dx}{dt} + \frac{dz}{du}\frac{\partial u}{\partial t}\frac{dt}{dt} = -\frac{x\cdot \mathrm{exp}\left(-\frac{x^2}{4Dt}\right)}{2Dt}\cdot x'(t) + \frac{x^2\cdot \mathrm{exp}\left(-\frac{x^2}{4Dt}\right)}{4Dt^2}\cdot 1$$

Assumptions about dependencies among variables (and what is a variable) can make a big difference.

-