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[xtan⁡x]=tan⁡x+xsec⁡2x\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=tan⁡xg = \tan x. The product rule is f′g+fg′f'g + fg', with f′=1f' = 1 and g′=sec⁡2xg' = \sec^2 x.

ddx[xtan⁡x]=(1)tan⁡x+x(sec⁡2x)=tan⁡x+xsec⁡2x\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 tan⁡x\tan x; the second from keeping xx and differentiating tan⁡x\tan x to sec⁡2x\sec^2 x. The key sub-fact is ddxtan⁡x=sec⁡2x\frac{d}{dx}\tan x = \sec^2 x.

Why the derivative of tan x is sec^2 x

Writing tan⁡x=sin⁡xcos⁡x\tan x = \frac{\sin x}{\cos x} and applying the quotient rule gives cos⁡xcos⁡x−sin⁡x(−sin⁡x)cos⁡2x=cos⁡2x+sin⁡2xcos⁡2x\frac{\cos x\cos x - \sin x(-\sin x)}{\cos^2 x} = \frac{\cos^2 x + \sin^2 x}{\cos^2 x}.

ddxtan⁡x=cos⁡2x+sin⁡2xcos⁡2x=1cos⁡2x=sec⁡2x\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 cos⁡2x+sin⁡2x=1\cos^2 x + \sin^2 x = 1 collapses the numerator to 11, and 1cos⁡2x\frac{1}{\cos^2 x} is sec⁡2x\sec^2 x. That is the g′g' used above.

Common mistakes

  • Answering sec⁡2x\sec^2 x alone and forgetting the product rule entirely. The factor of xx means two terms, not one.
  • Writing tan⁡x+sec⁡2x\tan x + \sec^2 x and dropping the xx on the second term. The product rule keeps xx attached to sec⁡2x\sec^2 x.
  • Using sec⁡xtan⁡x\sec x\tan x for the derivative of tan⁡x\tan x. That is the derivative of sec⁡x\sec x; the derivative of tan⁡x\tan x is sec⁡2x\sec^2 x.
  • Multiplying the derivatives as (1)(sec⁡2x)(1)(\sec^2 x). The product rule adds two terms f′g+fg′f'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 tan⁡x+xsec⁡2x\tan x + x\sec^2 x. The product rule gives (1)tan⁡x+xsec⁡2x(1)\tan x + x\sec^2 x, using ddxtan⁡x=sec⁡2x\frac{d}{dx}\tan x = \sec^2 x.

What is the derivative of tan x?

It is sec⁡2x\sec^2 x. From tan⁡x=sin⁡xcos⁡x\tan x = \frac{\sin x}{\cos x}, the quotient rule and the identity cos⁡2x+sin⁡2x=1\cos^2 x + \sin^2 x = 1 give 1cos⁡2x=sec⁡2x\frac{1}{\cos^2 x} = \sec^2 x.

Why are there two terms in the answer?

Because xtan⁡xx\tan x is a product. The product rule differentiates each factor in turn and adds the results, producing tan⁡x\tan x from the first factor and xsec⁡2xx\sec^2 x from the second.