# Question #53ac5

Feb 27, 2017

The $n$-th derivative can be evaluated recursively as:

${d}^{n} / \left({\mathrm{dx}}^{n}\right) f \left(x\right) = 2 \sin \left(x + \frac{n \pi}{2}\right) - {d}^{n - 2} / \left({\mathrm{dx}}^{n - 2}\right) f \left(x\right)$

with:

$f \left(x\right) = x \cos x$

$f ' \left(x\right) = \sin \left(x + \frac{\pi}{2}\right) - x \sin x$

#### Explanation:

We can start from the first derivative:

$f ' \left(x\right) = \frac{d}{\mathrm{dx}} \left(x \cos x\right) = \frac{d}{\mathrm{dx}} \left(x\right) \cos x + x \frac{d}{\mathrm{dx}} \left(\cos x\right) = \cos x - x \sin x$

Differentiating again:

$\left(1\right) f ' ' \left(x\right) = - \sin x - \left[\frac{d}{\mathrm{dx}} \left(x\right) \sin x + x \frac{d}{\mathrm{dx}} \left(\sin x\right)\right] = - 2 \sin x - f \left(x\right)$

Now we know that:

${d}^{n} / \left({\mathrm{dx}}^{n}\right) \sin x = \sin \left(x + \frac{n \pi}{2}\right)$

and in particular:

${d}^{2} / \left({\mathrm{dx}}^{2}\right) \sin x = - \sin x$

so that we can write $\left(1\right)$ as:

${d}^{2} / \left({\mathrm{dx}}^{2}\right) f \left(x\right) = 2 {d}^{2} / \left({\mathrm{dx}}^{2}\right) \sin x - f \left(x\right)$

and differentiating this equation we obtain a recursive formula for the derivatives of higher order:

${d}^{n} / \left({\mathrm{dx}}^{n}\right) f \left(x\right) = 2 {d}^{n} / \left({\mathrm{dx}}^{n}\right) \sin x - {d}^{n - 2} / \left({\mathrm{dx}}^{n - 2}\right) f \left(x\right)$

or:

${d}^{n} / \left({\mathrm{dx}}^{n}\right) f \left(x\right) = 2 \sin \left(x + \frac{n \pi}{2}\right) - {d}^{n - 2} / \left({\mathrm{dx}}^{n - 2}\right) f \left(x\right)$