# Chain rule

## Definition

### 1 dimensional case

Here [ilmath]f(x)[/ilmath] and [ilmath]g(t)[/ilmath] are functions:

$\frac{d}{dt}\Big[f\circ g\Big]=\left.\frac{df}{dx}\right|_{g(t)}\frac{dg}{dt}$

Then:

$\frac{d^2}{dt^2}\Big[f\circ g\Big]=\frac{d}{dt}\Big[\left.\frac{df}{dx}\right|_{g(t)}\frac{dg}{dt}\Big]$ $=\left.\frac{df}{dx}\right|_{g(t)}\cdot\frac{d}{dt}\Big[\frac{dg}{dt}\Big]+\frac{dg}{dt}\cdot\frac{d}{dt}\Big[\left.\frac{df}{dx}\right|_{g(t)}\Big]$ $=\left.\frac{df}{dx}\right|_{g(t)}\cdot\frac{d^2g}{dt^2}+\frac{dg}{dt}\cdot\frac{d}{dt}\Big[\left.\frac{df}{dx}\right|_{g(t)}\Big]$

That is: $\frac{d^2}{dt^2}\Big[f\circ g\Big]=\left.\frac{df}{dx}\right|_{g(t)}\cdot\frac{d^2g}{dt^2}+\frac{dg}{dt}\cdot\frac{d}{dt}\Big[\left.\frac{df}{dx}\right|_{g(t)}\Big]$

Little can be done about $\frac{d}{dt}\Big[\left.\frac{df}{dx}\right|_{g(t)}\Big]$ at this point. It is "the change in the rate of change of f with respect to x taken at g(t) with respect to t" which has little to do with $\frac{d^2f}{dx^2}$ computationally.