# Second derivative of $x \sin{\left(x \right)}$

The calculator will find the second derivative of $x \sin{\left(x \right)}$, with steps shown.

Related calculators: Derivative Calculator, Logarithmic Differentiation Calculator

Leave empty for autodetection.
Leave empty, if you don't need the derivative at a specific point.

If the calculator did not compute something or you have identified an error, or you have a suggestion/feedback, please write it in the comments below.

Find $\frac{d^{2}}{dx^{2}} \left(x \sin{\left(x \right)}\right)$.

### Find the first derivative $\frac{d}{dx} \left(x \sin{\left(x \right)}\right)$

Apply the product rule $\frac{d}{dx} \left(f{\left(x \right)} g{\left(x \right)}\right) = \frac{d}{dx} \left(f{\left(x \right)}\right) g{\left(x \right)} + f{\left(x \right)} \frac{d}{dx} \left(g{\left(x \right)}\right)$ with $f{\left(x \right)} = x$ and $g{\left(x \right)} = \sin{\left(x \right)}$:

$${\color{red}\left(\frac{d}{dx} \left(x \sin{\left(x \right)}\right)\right)} = {\color{red}\left(\frac{d}{dx} \left(x\right) \sin{\left(x \right)} + x \frac{d}{dx} \left(\sin{\left(x \right)}\right)\right)}$$

The derivative of the sine is $\frac{d}{dx} \left(\sin{\left(x \right)}\right) = \cos{\left(x \right)}$:

$$x {\color{red}\left(\frac{d}{dx} \left(\sin{\left(x \right)}\right)\right)} + \sin{\left(x \right)} \frac{d}{dx} \left(x\right) = x {\color{red}\left(\cos{\left(x \right)}\right)} + \sin{\left(x \right)} \frac{d}{dx} \left(x\right)$$

Apply the power rule $\frac{d}{dx} \left(x^{n}\right) = n x^{n - 1}$ with $n = 1$, in other words, $\frac{d}{dx} \left(x\right) = 1$:

$$x \cos{\left(x \right)} + \sin{\left(x \right)} {\color{red}\left(\frac{d}{dx} \left(x\right)\right)} = x \cos{\left(x \right)} + \sin{\left(x \right)} {\color{red}\left(1\right)}$$

Thus, $\frac{d}{dx} \left(x \sin{\left(x \right)}\right) = x \cos{\left(x \right)} + \sin{\left(x \right)}$.

### Next, $\frac{d^{2}}{dx^{2}} \left(x \sin{\left(x \right)}\right) = \frac{d}{dx} \left(x \cos{\left(x \right)} + \sin{\left(x \right)}\right)$

The derivative of a sum/difference is the sum/difference of derivatives:

$${\color{red}\left(\frac{d}{dx} \left(x \cos{\left(x \right)} + \sin{\left(x \right)}\right)\right)} = {\color{red}\left(\frac{d}{dx} \left(x \cos{\left(x \right)}\right) + \frac{d}{dx} \left(\sin{\left(x \right)}\right)\right)}$$

The derivative of the sine is $\frac{d}{dx} \left(\sin{\left(x \right)}\right) = \cos{\left(x \right)}$:

$${\color{red}\left(\frac{d}{dx} \left(\sin{\left(x \right)}\right)\right)} + \frac{d}{dx} \left(x \cos{\left(x \right)}\right) = {\color{red}\left(\cos{\left(x \right)}\right)} + \frac{d}{dx} \left(x \cos{\left(x \right)}\right)$$

Apply the product rule $\frac{d}{dx} \left(f{\left(x \right)} g{\left(x \right)}\right) = \frac{d}{dx} \left(f{\left(x \right)}\right) g{\left(x \right)} + f{\left(x \right)} \frac{d}{dx} \left(g{\left(x \right)}\right)$ with $f{\left(x \right)} = x$ and $g{\left(x \right)} = \cos{\left(x \right)}$:

$$\cos{\left(x \right)} + {\color{red}\left(\frac{d}{dx} \left(x \cos{\left(x \right)}\right)\right)} = \cos{\left(x \right)} + {\color{red}\left(\frac{d}{dx} \left(x\right) \cos{\left(x \right)} + x \frac{d}{dx} \left(\cos{\left(x \right)}\right)\right)}$$

The derivative of the cosine is $\frac{d}{dx} \left(\cos{\left(x \right)}\right) = - \sin{\left(x \right)}$:

$$x {\color{red}\left(\frac{d}{dx} \left(\cos{\left(x \right)}\right)\right)} + \cos{\left(x \right)} \frac{d}{dx} \left(x\right) + \cos{\left(x \right)} = x {\color{red}\left(- \sin{\left(x \right)}\right)} + \cos{\left(x \right)} \frac{d}{dx} \left(x\right) + \cos{\left(x \right)}$$

Apply the power rule $\frac{d}{dx} \left(x^{n}\right) = n x^{n - 1}$ with $n = 1$, in other words, $\frac{d}{dx} \left(x\right) = 1$:

$$- x \sin{\left(x \right)} + \cos{\left(x \right)} {\color{red}\left(\frac{d}{dx} \left(x\right)\right)} + \cos{\left(x \right)} = - x \sin{\left(x \right)} + \cos{\left(x \right)} {\color{red}\left(1\right)} + \cos{\left(x \right)}$$

Thus, $\frac{d}{dx} \left(x \cos{\left(x \right)} + \sin{\left(x \right)}\right) = - x \sin{\left(x \right)} + 2 \cos{\left(x \right)}$.

Therefore, $\frac{d^{2}}{dx^{2}} \left(x \sin{\left(x \right)}\right) = - x \sin{\left(x \right)} + 2 \cos{\left(x \right)}$.

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