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.
dxd[xtanx]=tanx+xsec2x
The proof: product rule on x tan x
This is a product of two functions, f=x and g=tanx. The product rule is f′g+fg′, with f′=1 and g′=sec2x.
dxd[xtanx]=(1)tanx+x(sec2x)=tanx+xsec2x
The first term comes from differentiating x and leaving tanx; the second from keeping x and differentiating tanx to sec2x. The key sub-fact is dxdtanx=sec2x.
Why the derivative of tan x is sec^2 x
Writing tanx=cosxsinx and applying the quotient rule gives cos2xcosxcosx−sinx(−sinx)=cos2xcos2x+sin2x.
dxdtanx=cos2xcos2x+sin2x=cos2x1=sec2x
The Pythagorean identity cos2x+sin2x=1 collapses the numerator to 1, and cos2x1 is sec2x. That is the g′ used above.
Common mistakes
Answering sec2x alone and forgetting the product rule entirely. The factor of x means two terms, not one.
Writing tanx+sec2x and dropping the x on the second term. The product rule keeps x attached to sec2x.
Using secxtanx for the derivative of tanx. That is the derivative of secx; the derivative of tanx is sec2x.
Multiplying the derivatives as (1)(sec2x). The product rule adds two terms 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 tanx+xsec2x. The product rule gives (1)tanx+xsec2x, using dxdtanx=sec2x.
What is the derivative of tan x?
It is sec2x. From tanx=cosxsinx, the quotient rule and the identity cos2x+sin2x=1 give cos2x1=sec2x.
Why are there two terms in the answer?
Because xtanx is a product. The product rule differentiates each factor in turn and adds the results, producing tanx from the first factor and xsec2x from the second.