AP Calculus BC
Integral of x sec^2 x: Parts Then tan x
Parts with u equal to x turns sec squared x into tan x, and what is left over is the integral of tan x, which has to be done separately. The answer is x tan x plus the natural log of the absolute value of cos x, plus C.
Parts, with tan x waiting at the end
Take and . Then and , since is the derivative of tangent. Parts turns the product into a finished piece and a leftover integral.
That leftover is not free. , which is its own substitution problem with . Subtracting that negative is where the plus sign in the final answer comes from.
One problem, two techniques
Parts does not finish this integral. It converts the problem into a smaller one, and you have to recognise the smaller one on sight. Free response questions lean on exactly this: a first move that succeeds only if a second standard result is already in memory.
The absolute value bars matter here. is negative on half of its period, and the antiderivative breaks at every odd multiple of , where blows up. The formula is valid on one such interval at a time, and the constant of integration can differ from one interval to the next.
A quick derivative check
Differentiating x tan x by the product rule gives tan x plus x sec^2 x. Differentiating ln|cos x| gives negative tan x. The two tangent terms cancel and you are left with x sec^2 x, which is the point.
The mistakes students make
Almost every wrong answer on this integral comes from the second half of the work, not the first.
- Writing with no minus sign. The answer becomes , which differentiates to .
- Choosing and . The leftover integral is , which is harder than the original.
- Dropping the absolute value bars and writing , which is undefined on any interval where cosine is negative.
Every answer on this page is machine checked
An automated test differentiates the antiderivative above and confirms it returns the integrand. A wrong sign or a missing factor fails the build, so it cannot reach you.
Frequently asked questions
What does x sec^2 x integrate to?
To .
Why does the answer have a plus ln|cos x| and not a minus?
Parts leaves , and . Subtracting that negative gives .
Can I use u-substitution instead of parts?
No. Nothing in is the derivative of anything else in it, so substitution has nothing to cancel. The factor is what signals parts.