Derivative of x cos x
The derivative of x cos x is cos x − x sin x. The product rule gives two terms, and the minus sign comes from the derivative of cosine.
How to find the derivative of x cos x
Method: product rule.
- 1Use the product rule, with f = x and g = cos x.
- 2f′ = 1 and g′ = −sin x.
- 3So the derivative is 1 · cos x + x · (−sin x).
- 4That is cos x − x sin x.
What it means on the graph
x cos x grows in amplitude as x increases. At x = 0, the slope is exactly 1, which is why the curve looks like y = x near the origin.
In the window shown, the derivative is zero at 8 points in this window. Those are the points where the graph of x cos x has a horizontal tangent.
Table of values
The derivative column uses the formula. The last column estimates the slope directly from the original function, as an independent check.
| x | x cos x | cos x − x sin x | Slope, measured |
|---|---|---|---|
| −π | π | −1 | −1 |
| −π/2 | 0 | −π/2 | −π/2 |
| 0 | 0 | 1 | 1 |
| π/2 | 0 | −π/2 | −π/2 |
| π | −π | −1 | −1 |
Second derivative
Differentiating once more gives:
The second derivative tells you which way the graph bends: positive means it curves upward, and negative means it curves downward.
Common mistakes
- Dropping the minus sign on the second term.
Frequently asked questions
What is the derivative of x cos x?
What is the second derivative of x cos x?
Keep going
Type your own function into the derivative calculator and see every rule applied, step by step.