AP Calculus AB and BC

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

The derivative of x squared times sin x with respect to x is 2x sin x + x^2 cos x. The product rule differentiates each factor once: 2x times sin x plus x squared times cos x. The derivative of a product is never the product of the derivatives, so the answer keeps both terms.

ddx[x2sinx]=2xsinx+x2cosx\frac{d}{dx}\left[x^2\sin x\right] = 2x\sin x + x^2\cos x

How to differentiate x^2 sin x

The expression is a product of x2x^{2} and sinx\sin x, so the product rule differentiates each factor once, holding the other fixed, and adds.

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)=x2f(x) = x^{2} and g(x)=sinxg(x) = \sin x, so f(x)=2xf'(x) = 2x and g(x)=cosxg'(x) = \cos x.

ddx(x2sinx)=2xsinx+x2cosx\frac{d}{dx}\left(x^{2}\sin x\right) = 2x\sin x + x^{2}\cos x

Unlike x2exx^{2}e^{x}, the two terms share no common exponential or trigonometric factor to pull out. Factoring the common xx only gives x(2sinx+xcosx)x(2\sin x + x\cos x), which is no simpler, so the expanded form 2xsinx+x2cosx2x\sin x + x^{2}\cos x is the standard answer.

Why the product rule is necessary

If the derivative of a product were the product of the derivatives, the answer would be 2xcosx2x\cos x. Test it at x=π2x = \frac{\pi}{2}: the real derivative is 2π21+(π2)20=π2\cdot\frac{\pi}{2}\cdot 1 + \left(\frac{\pi}{2}\right)^{2}\cdot 0 = \pi, while 2xcosx=π0=02x\cos x = \pi\cdot 0 = 0. They disagree, so the shortcut is false.

The reverse operation, x2sinxdx\int x^{2}\sin x\,dx, needs integration by parts applied twice.

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

The product rule is Topic 2.8, on both AB and BC. A polynomial times a trigonometric function is a standard example, because one factor differentiates to a simple power and the structure of the rule stays visible.

Common mistakes with the derivative of x^2 sin x

  • Answering 2xcosx2x\cos x, multiplying the two derivatives instead of using the product rule.
  • Answering 2xsinx+cosx2x\sin x + \cos x, dropping the x2x^{2} that multiplies cosx\cos x in the second term.
  • Answering 2xsinxx2cosx2x\sin x - x^{2}\cos x, adding a wrong minus sign; sinx\sin x differentiates to +cosx+\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^2 sin x?

ddx(x2sinx)=2xsinx+x2cosx\frac{d}{dx}(x^{2}\sin x) = 2x\sin x + x^{2}\cos x, from the product rule.

Why isn't the answer 2x cos x?

Because the derivative of a product is not the product of the derivatives. You keep each factor once: fg+fg=2xsinx+x2cosxf'g + fg' = 2x\sin x + x^{2}\cos x.

What is the integral of x^2 sin x?

x2sinxdx=x2cosx+2xsinx+2cosx+C\int x^{2}\sin x\,dx = -x^{2}\cos x + 2x\sin x + 2\cos x + C, by integration by parts applied twice.