AP Calculus AB and BC

Derivative of x sin x: Answer, Product Rule, Mistakes

The derivative of x sin x with respect to x is sin x plus x cos x. This needs the product rule, because the expression is a product of two functions that each depend on x. The derivative of a product is never the product of the derivatives.

ddx[xsin⁡x]=sin⁡x+xcos⁡x\frac{d}{dx}\left[x\sin x\right] = \sin x + x\cos x

How to differentiate x sin x

The product rule differentiates each factor in turn, keeping the other one fixed, and adds the results.

ddx[f(x)g(x)]=f′(x)g(x)+f(x)g′(x)\frac{d}{dx}\left[f(x)g(x)\right] = f'(x)g(x) + f(x)g'(x)

Take f(x)=xf(x) = x and g(x)=sin⁡xg(x) = \sin x, so f′(x)=1f'(x) = 1 and g′(x)=cos⁡xg'(x) = \cos x.

ddx(xsin⁡x)=1⋅sin⁡x+x⋅cos⁡x\frac{d}{dx}\left(x\sin x\right) = 1\cdot\sin x + x\cdot\cos x

Why the product rule is necessary

If the derivative of a product were the product of the derivatives, the answer would be cos⁡x\cos x. Test it at x=0x = 0: the real derivative is sin⁡0+0=0\sin 0 + 0 = 0, while cos⁡0=1\cos 0 = 1. They disagree, so the shortcut is false.

The same integrand also appears in Unit 6, where ∫xsin⁡x dx\int x\sin x\,dx needs integration by parts, the reverse of the product rule.

Where the derivative of x sin x shows up on the AP exam

Topic 2.8 (The Product Rule) on both exams. It is the standard example because one factor is trivially differentiable, so the structure of the rule is visible without algebra getting in the way.

Common mistakes with the derivative of x sin x

  • Answering cos⁡x\cos x, multiplying the derivatives.
  • Answering xcos⁡xx\cos x and dropping the first term.
  • Swapping which factor gets differentiated and writing sin⁡x+cos⁡x\sin x + \cos x.

Check yourself, not just the answer

Type derivatives and get graded on mathematical equivalence, with rule-level hints when you miss, in the Derivative Practice Checker.

Frequently asked questions

What is the derivative of x sin x?

It is sin⁡x+xcos⁡x\sin x + x\cos x.

Why can I not just multiply the derivatives?

Because the product rule is not multiplicative. At x=0x = 0 the true derivative is 00 while the product of derivatives is 11.

What is the integral of x sin x?

It is sin⁡x−xcos⁡x+C\sin x - x\cos x + C, by integration by parts, which is the product rule reversed.

What is the second derivative of x sin x?

It is 2cos⁡x−xsin⁡x2\cos x - x\sin x, from differentiating sin⁡x+xcos⁡x\sin x + x\cos x with the product rule again.