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[xsinx]=sinx+xcosx\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)=sinxg(x) = \sin x, so f(x)=1f'(x) = 1 and g(x)=cosxg'(x) = \cos x.

ddx(xsinx)=1sinx+xcosx\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 cosx\cos x. Test it at x=0x = 0: the real derivative is sin0+0=0\sin 0 + 0 = 0, while cos0=1\cos 0 = 1. They disagree, so the shortcut is false.

The same integrand also appears in Unit 6, where xsinxdx\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 cosx\cos x, multiplying the derivatives.
  • Answering xcosxx\cos x and dropping the first term.
  • Swapping which factor gets differentiated and writing sinx+cosx\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 sinx+xcosx\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 sinxxcosx+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 2cosxxsinx2\cos x - x\sin x, from differentiating sinx+xcosx\sin x + x\cos x with the product rule again.