AP Calculus AB and BC

Derivative of x^2 cos x: Product Rule

The derivative of x squared times cos x is 2x cos x minus x squared sin x. The product rule differentiates each factor in turn, and the minus sign comes from differentiating cosine in the second term.

ddx[x2cosx]=2xcosxx2sinx\frac{d}{dx}\left[x^{2}\cos x\right] = 2x\cos x - x^{2}\sin x

The product rule

ddx(x2cosx)=2xcosx+x2(sinx)=2xcosxx2sinx\frac{d}{dx}\left(x^{2}\cos x\right) = 2x\cos x + x^{2}(-\sin x) = 2x\cos x - x^{2}\sin x

The rule itself adds the two pieces; the minus sign appears because the derivative of cosine is negative sine, not because of the rule.

The integral needs parts twice

Reversing this is the standard repeated integration by parts problem, since the algebraic factor drops by one degree on each pass.

x2cosxdx=x2sinx+2xcosx2sinx+C\int x^{2}\cos x\,dx = x^{2}\sin x + 2x\cos x - 2\sin x + C

Common mistakes

  • Multiplying the derivatives to get 2xsinx-2x\sin x.
  • Writing a plus sign in front of x2sinxx^{2}\sin x by forgetting where the minus came from.
  • Applying the chain rule instead. This is a product, not a composition.

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 cos x?

It is 2xcosxx2sinx2x\cos x - x^{2}\sin x.

Where does the minus sign come from?

From differentiating cosx\cos x to sinx-\sin x in the second product-rule term.

What is the integral?

x2sinx+2xcosx2sinx+Cx^{2}\sin x + 2x\cos x - 2\sin x + C, by integration by parts twice.