Tutorials › Calculus II › Using t = tan x When sec² x Is Present

Rationalizing Substitutions · Tutorial 243 of 998

Using t = tan x When sec² x Is Present

Use \(t=\tan x\) to rationalize the integrand on a valid branch, then handle intervals crossing tangent poles as separate improper integrals.

Intermediate 9 min read

What You'll Learn

  • Identify integrals suited to the substitution \(t=\tan x\).
  • Convert the trigonometric integrand and differential into a rational integral.
  • State the interval conditions that make tangent one-to-one.
  • Find transformed limits on a single tangent branch.
  • Split an integral at tangent poles and assess the resulting improper integrals.
  • Check antiderivatives by differentiation and definite integrals by evaluation.

Why This Substitution Works

When an integrand contains a rational expression in \(\tan x\) multiplied by \(\sec^2 x\), the derivative of \(\tan x\) is already present. Setting \(t=\tan x\) then replaces both the trigonometric expression and the differential, leaving an integral of a rational function of \(t\).

The substitution is straightforward on intervals where tangent is continuous and one-to-one. It needs more care on an interval that crosses a pole of tangent: the interval must be split into branches, and a definite integral across the pole must be treated as an improper integral.

Key substitution: If \(t=\tan x\), then \(dt=\sec^2 x\,dx\). Thus, for a rational function \(R\), $$ \int R(\tan x)\sec^2 x\,dx=\int R(t)\,dt $$ on any interval where the substitution is being applied.

The Tangent Branches

Tangent has period \(\pi\) and has poles at \(x=\frac{\pi}{2}+k\pi\), where \(k\) is an integer. Its maximal intervals of continuity are

$$ I_k=\left(-\frac{\pi}{2}+k\pi,\frac{\pi}{2}+k\pi\right), \qquad k\in\mathbb Z. $$

On each \(I_k\), tangent is strictly increasing and takes every real value exactly once. Indeed, \(\frac{d}{dx}\tan x=\sec^2 x>0\) wherever tangent is defined, and tangent approaches \(-\infty\) and \(+\infty\) at the left and right ends of each such interval. Therefore \(t=\tan x\) is a valid one-to-one change of variable on any subinterval contained in a single \(I_k\).

For an indefinite integral, the resulting antiderivative is initially valid on a pole-free interval. For a definite integral whose limits lie in one branch, the limits transform in the usual way: \(x=a\) becomes \(t=\tan a\), and \(x=b\) becomes \(t=\tan b\). If the interval crosses a pole, tangent is not one-to-one or continuous over the whole interval, so the substitution cannot be applied as one unbroken change of variable.

Definition: A tangent branch is one of the intervals \(I_k\) above. To use \(t=\tan x\) as a single one-to-one substitution, the interval of integration must lie within one tangent branch. An interval crossing a pole must instead be split at that pole.

Deriving the Rational Integral

Suppose \(R\) is a rational function and consider \(\int R(\tan x)\sec^2 x\,dx\) on an interval contained in one tangent branch. Put \(t=\tan x\). Differentiating gives \(dt=\sec^2 x\,dx\), so the factor multiplying \(R(\tan x)\) is exactly the differential needed for the substitution. Also, \(R(\tan x)=R(t)\). These two replacements give \(\int R(t)\,dt\).

The reason this calculation gives an antiderivative can be seen by the chain rule. Let \(F\) be an antiderivative of \(R\), so that \(F'(t)=R(t)\). Then

$$ \frac{d}{dx}F(\tan x) =F'(\tan x)\frac{d}{dx}(\tan x) =R(\tan x)\sec^2 x. $$

Thus, wherever the expressions are defined on a branch, \(F(\tan x)\) is an antiderivative of the original integrand. The rational integral may then be evaluated using methods for rational functions; the substitution itself does not guarantee that every resulting rational integral is easy.

1
Check the factors.
Look for a rational expression in \(\tan x\) multiplied by \(\sec^2 x\).
2
Choose a branch.
For a single substitution, work on an interval with no tangent pole.
3
Substitute.
Set \(t=\tan x\) and \(dt=\sec^2 x\,dx\), including transformed limits for a definite integral.
4
Integrate and check.
Find an antiderivative of the rational function, then differentiate the result after substituting \(t=\tan x\).

Worked Examples

Worked Example: Integrating a Polynomial in Tangent

Evaluate \(\int (\tan^2 x+2\tan x+3)\sec^2 x\,dx\) on an interval containing no tangent pole.

Set \(t=\tan x\). Then \(dt=\sec^2 x\,dx\), so the integral becomes

$$ \int (t^2+2t+3)\,dt =\frac{t^3}{3}+t^2+3t+C. $$

Substitute back to obtain

$$ \frac{\tan^3 x}{3}+\tan^2 x+3\tan x+C. $$

To check, differentiate each term:

$$ \frac{d}{dx}\left(\frac{\tan^3 x}{3}+\tan^2 x+3\tan x\right) =\tan^2 x\sec^2 x+2\tan x\sec^2 x+3\sec^2 x =(\tan^2 x+2\tan x+3)\sec^2 x. $$

The derivative is the original integrand, as required.

Worked Example: A Logarithm from a Rational Function

Evaluate \(\int \frac{2\tan x+1}{\tan^2 x+\tan x+3}\sec^2 x\,dx\) on an interval containing no tangent pole.

With \(t=\tan x\), the integral becomes

$$ \int \frac{2t+1}{t^2+t+3}\,dt. $$

The denominator has derivative \(2t+1\), the numerator. Therefore, using \(u=t^2+t+3\) and \(du=(2t+1)\,dt\), we get

$$ \int \frac{du}{u}=\ln|u|+C =\ln|t^2+t+3|+C. $$

In fact, \(t^2+t+3=(t+\frac12)^2+\frac{11}{4}>0\) for every real \(t\), so the absolute-value signs can be removed. Substituting back gives \(\ln(\tan^2 x+\tan x+3)+C\). Check by differentiation:

$$ \frac{d}{dx}\ln(\tan^2 x+\tan x+3) =\frac{2\tan x+1}{\tan^2 x+\tan x+3}\sec^2 x. $$

This matches the integrand.

Worked Example: A Definite Integral on One Branch

Evaluate \(\int_0^{\pi/4}\frac{\tan x\,\sec^2 x}{(1+\tan^2 x)^2}\,dx\). The interval \([0,\pi/4]\) lies inside the branch \((-\pi/2,\pi/2)\).

Set \(t=\tan x\). The limits become \(t=0\) at \(x=0\) and \(t=1\) at \(x=\pi/4\), and \(dt=\sec^2 x\,dx\). Hence

$$ \int_0^{\pi/4}\frac{\tan x\,\sec^2 x}{(1+\tan^2 x)^2}\,dx =\int_0^1\frac{t}{(1+t^2)^2}\,dt. $$

An antiderivative is \(-\frac{1}{2(1+t^2)}\), since

$$ \frac{d}{dt}\left(-\frac{1}{2(1+t^2)}\right) =\frac{t}{(1+t^2)^2}. $$

Therefore, evaluating at the limits gives

$$ \left[-\frac{1}{2(1+t^2)}\right]_0^1 =-\frac14-\left(-\frac12\right) =\frac14. $$

As a check, the antiderivative in \(x\) is \(-\frac{1}{2(1+\tan^2 x)}\). Differentiating it gives \(\frac{\tan x\sec^2 x}{(1+\tan^2 x)^2}\), and its endpoint values give the same result, \(\frac14\).

When the Interval Crosses a Pole

A definite integral across a tangent pole cannot be transformed using a single pair of finite tangent limits. Instead, split it at the pole and evaluate each side as an improper integral. Each side stays within one tangent branch, but one transformed endpoint may be infinite. The one-sided limits must exist for the improper integral to converge; if both sides converge, their values are added.

Worked Example: Splitting at a Tangent Pole

Consider \(\int_0^\pi \frac{\sec^2 x}{1+\tan^2 x}\,dx\), interpreted as an improper integral at \(x=\pi/2\). On its domain, the integrand simplifies to \(1\), so the improper integral should have value \(\pi\). The substitution also confirms this, provided the interval is split.

On \([0,\pi/2)\), set \(t=\tan x\). The transformed limits are \(0\) and \(+\infty\), giving

$$ \lim_{b\to\pi/2^-}\int_0^b \frac{\sec^2 x}{1+\tan^2 x}\,dx =\int_0^\infty\frac{dt}{1+t^2} =\lim_{T\to\infty}\arctan T =\frac{\pi}{2}. $$

On \((\pi/2,\pi]\), tangent increases from \(-\infty\) to \(0\). Thus

$$ \lim_{a\to\pi/2^+}\int_a^\pi \frac{\sec^2 x}{1+\tan^2 x}\,dx =\int_{-\infty}^0\frac{dt}{1+t^2} =\lim_{T\to-\infty}\bigl(\arctan 0-\arctan T\bigr) =\frac{\pi}{2}. $$

Both one-sided integrals converge, and their sum is \(\frac{\pi}{2}+\frac{\pi}{2}=\pi\), agreeing with the simplified integrand. The value at the single pole is not needed to define the improper integral.

A Common Mistake

It is incorrect to substitute \(t=\tan x\) across a pole as though tangent were one-to-one on the whole interval. For the last example, one might incorrectly use \(t=\tan x\) from \(x=0\) to \(x=\pi\), see that both endpoint values are \(0\), and conclude

$$ \int_0^\pi \frac{dt}{1+t^2}=0. $$

This calculation is invalid: the \(t\)-integral does not have the same path as a single substitution over \([0,\pi]\). As \(x\) approaches \(\pi/2\) from the left, \(\tan x\) tends to \(+\infty\); just to the right, it starts at \(-\infty\). The correct transformed integrals are the two separate improper integrals, from \(0\) to \(+\infty\) and from \(-\infty\) to \(0\), whose sum is \(\pi\).

Takeaway: Matching the endpoint values of \(\tan x\) does not justify a substitution across a pole. Check the branch first; if the interval crosses a pole, split it and evaluate the one-sided improper integrals separately.

Check Your Understanding

Use the branch condition as well as the algebra when deciding whether the substitution is valid.

  1. Use \(t=\tan x\) to find an antiderivative of \(\tan^4 x\sec^2 x\), and check it by differentiation.
  2. For which maximal intervals is tangent one-to-one, and where are its poles?
  3. Transform \(\int_0^{\pi/4}\frac{\sec^2 x}{1+\tan^2 x}\,dx\) into a rational integral and evaluate it.
  4. Why can’t \(t=\tan x\) be used as one continuous, one-to-one substitution on \([0,\pi]\)?
  5. What must be checked before adding the two pieces of an improper integral split at a tangent pole?

Test yourself: Calculus II final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon