# Find a formula for nth derivative of f(x)=x sin x?

Apr 26, 2018

${y}^{\left(n\right)} = n \sin \left(x + \frac{\left(n - 1\right) \pi}{2}\right) + x \sin \left(x + n \frac{\pi}{2}\right)$

#### Explanation:

We seek the ${n}^{t h}$ derivative of:

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

Starting with the given function:

${f}^{\left(0\right)} \left(x\right) = x \sin x$

Using the product rule we compute the first derivative:

${f}^{\left(1\right)} \left(x\right) = x \left(\frac{d}{\mathrm{dx}} \sin x\right) + \left(\frac{d}{\mathrm{dx}} x\right) \sin x$
$\setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus = x \cos x + \sin x$

Similarity, for the second derivative

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

And further derivatives:

${f}^{\left(3\right)} \left(x\right) = - 2 \sin x - \left(x \cos x + \sin x\right)$
$\setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus = - 3 \sin x - x \cos x$

${f}^{\left(4\right)} \left(x\right) = - 3 \cos x - \left(- x \sin x + \cos x\right)$
$\setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus = - 4 \cos x + x \sin x$

So, By exploiting the phase shift properties, we have:

${y}^{\left(n\right)} = n \sin \left(x + \frac{\left(n - 1\right) \pi}{2}\right) + x \sin \left(x + n \frac{\pi}{2}\right)$