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[x2sin⁡x]=2xsin⁡x+x2cos⁡x\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 sin⁡x\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)=sin⁡xg(x) = \sin x, so f′(x)=2xf'(x) = 2x and g′(x)=cos⁡xg'(x) = \cos x.

ddx(x2sin⁡x)=2xsin⁡x+x2cos⁡x\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(2sin⁡x+xcos⁡x)x(2\sin x + x\cos x), which is no simpler, so the expanded form 2xsin⁡x+x2cos⁡x2x\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 2xcos⁡x2x\cos x. Test it at x=π2x = \frac{\pi}{2}: the real derivative is 2⋅π2⋅1+(π2)2⋅0=π2\cdot\frac{\pi}{2}\cdot 1 + \left(\frac{\pi}{2}\right)^{2}\cdot 0 = \pi, while 2xcos⁡x=π⋅0=02x\cos x = \pi\cdot 0 = 0. They disagree, so the shortcut is false.

The reverse operation, ∫x2sin⁡x dx\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 2xcos⁡x2x\cos x, multiplying the two derivatives instead of using the product rule.
  • Answering 2xsin⁡x+cos⁡x2x\sin x + \cos x, dropping the x2x^{2} that multiplies cos⁡x\cos x in the second term.
  • Answering 2xsin⁡x−x2cos⁡x2x\sin x - x^{2}\cos x, adding a wrong minus sign; sin⁡x\sin x differentiates to +cos⁡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^2 sin x?

ddx(x2sin⁡x)=2xsin⁡x+x2cos⁡x\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: f′g+fg′=2xsin⁡x+x2cos⁡xf'g + fg' = 2x\sin x + x^{2}\cos x.

What is the integral of x^2 sin x?

∫x2sin⁡x dx=−x2cos⁡x+2xsin⁡x+2cos⁡x+C\int x^{2}\sin x\,dx = -x^{2}\cos x + 2x\sin x + 2\cos x + C, by integration by parts applied twice.