AP Calculus AB and BC

Derivative of x tan x: Answer, Proof, Mistakes

The derivative of x tan x with respect to x is tan x + x sec^2 x. The product rule differentiates x to 1, giving tan x, then keeps x and differentiates tan x to sec^2 x, giving x sec^2 x. Adding the two pieces yields tan x + x sec^2 x, valid wherever tan x is defined.

ddx[xtanx]=tanx+xsec2x\frac{d}{dx}\left[x\tan x\right] = \tan x + x\sec^2 x

The proof: product rule on x tan x

This is a product of two functions, f=xf = x and g=tanxg = \tan x. The product rule is fg+fgf'g + fg', with f=1f' = 1 and g=sec2xg' = \sec^2 x.

ddx[xtanx]=(1)tanx+x(sec2x)=tanx+xsec2x\frac{d}{dx}\left[x\tan x\right] = (1)\tan x + x(\sec^2 x) = \tan x + x\sec^2 x

The first term comes from differentiating xx and leaving tanx\tan x; the second from keeping xx and differentiating tanx\tan x to sec2x\sec^2 x. The key sub-fact is ddxtanx=sec2x\frac{d}{dx}\tan x = \sec^2 x.

Why the derivative of tan x is sec^2 x

Writing tanx=sinxcosx\tan x = \frac{\sin x}{\cos x} and applying the quotient rule gives cosxcosxsinx(sinx)cos2x=cos2x+sin2xcos2x\frac{\cos x\cos x - \sin x(-\sin x)}{\cos^2 x} = \frac{\cos^2 x + \sin^2 x}{\cos^2 x}.

ddxtanx=cos2x+sin2xcos2x=1cos2x=sec2x\frac{d}{dx}\tan x = \frac{\cos^2 x + \sin^2 x}{\cos^2 x} = \frac{1}{\cos^2 x} = \sec^2 x

The Pythagorean identity cos2x+sin2x=1\cos^2 x + \sin^2 x = 1 collapses the numerator to 11, and 1cos2x\frac{1}{\cos^2 x} is sec2x\sec^2 x. That is the gg' used above.

Common mistakes

  • Answering sec2x\sec^2 x alone and forgetting the product rule entirely. The factor of xx means two terms, not one.
  • Writing tanx+sec2x\tan x + \sec^2 x and dropping the xx on the second term. The product rule keeps xx attached to sec2x\sec^2 x.
  • Using secxtanx\sec x\tan x for the derivative of tanx\tan x. That is the derivative of secx\sec x; the derivative of tanx\tan x is sec2x\sec^2 x.
  • Multiplying the derivatives as (1)(sec2x)(1)(\sec^2 x). The product rule adds two terms fg+fgf'g + fg'; it does not multiply the two derivatives together.

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

It is tanx+xsec2x\tan x + x\sec^2 x. The product rule gives (1)tanx+xsec2x(1)\tan x + x\sec^2 x, using ddxtanx=sec2x\frac{d}{dx}\tan x = \sec^2 x.

What is the derivative of tan x?

It is sec2x\sec^2 x. From tanx=sinxcosx\tan x = \frac{\sin x}{\cos x}, the quotient rule and the identity cos2x+sin2x=1\cos^2 x + \sin^2 x = 1 give 1cos2x=sec2x\frac{1}{\cos^2 x} = \sec^2 x.

Why are there two terms in the answer?

Because xtanxx\tan x is a product. The product rule differentiates each factor in turn and adds the results, producing tanx\tan x from the first factor and xsec2xx\sec^2 x from the second.