## Feynman’s Differentiation Trick

Feynman’s Tips on Physics describes the following trick to take derivatives quickly.

Suppose

$f = u^av^bw^c$

is a function mapping reals to reals.

Then

$\frac{df}{dx} = a\frac{du}{dx}u^{a-1}v^bw^c + u^ab\frac{dv}{dx}v^{b-1}w^c + u^av^bc\frac{dw}{dx}w^{c-1}$

Next notice that each of these terms almost has $f$ itself in it, so we factor $f$ out.

$\frac{df}{dx} = f\left(a\frac{du/dx}{u} + b\frac{dv/dx}{v} + c\frac{dw/dx}{w}\right)$.

That’s the trick. It’s not incredibly powerful, but here’s how it works on an example:

$f=\frac{\sin^3(x)\sqrt{e^{x+x^2}}}{\left(x^2+1\right)^{1/3}}$.

We’ll let

$u = \sin(x), a=3$
$v = e^{x+x^2}, b=1/2$
$w = x^2 + 1, c=-1/3$

Next we write $f$ over again.

$\frac{df}{dx} = \frac{\sin^3(x)\sqrt{e^{x+x^2}}}{\left(x^2+1\right)^{1/3}}*[\ldots]$.

Then insert $a\frac{du/dx}{u}$.

$\frac{df}{dx} = \frac{\sin^3(x)\sqrt{e^{x+x^2}}}{\left(x^2+1\right)^{1/3}}*\left[3\frac{\cos(x)}{\sin(x)}+\ldots\right]$

And then add $b\frac{dv/dx}{v}$.

$\frac{df}{dx} = \frac{\sin^3(x)\sqrt{e^{x+x^2}}}{\left(x^2+1\right)^{1/3}}*\left[3\frac{\cos(x)}{\sin(x)}+\frac{1}{2}\frac{e^{x+x^2}(1+2x)}{e^{x+x^2}}+\ldots\right]$.

Finish it up with $c\frac{dw/dx}{w}$.

$\frac{df}{dx} = \frac{\sin^3(x)\sqrt{e^{x+x^2}}}{\left(x^2+1\right)^{1/3}}*\left[3\frac{\cos(x)}{\sin(x)}+\frac{1}{2}\frac{e^{x+x^2}(1+2x)}{e^{x+x^2}}+\frac{-1}{3}\frac{2x}{x^2+1} \right]$.