AP Calculus AB and BC

Integral of tan 2x: Answer and Substitution

The integral of tan 2x is negative one half times the natural log of the absolute value of cos 2x, plus C. Write tangent as sine over cosine and substitute u equals cos 2x; the inner factor of 2 leaves a one half in front.

tan2xdx=12lncos2x+C\int \tan 2x\,dx = -\frac{1}{2}\ln\left|\cos 2x\right| + C

The substitution

Rewrite tangent as a quotient, then let u=cos2xu = \cos 2x, so du=2sin2xdxdu = -2\sin 2x\,dx.

sin2xcos2xdx=12duu=12lnu+C\int \frac{\sin 2x}{\cos 2x}\,dx = -\frac{1}{2}\int \frac{du}{u} = -\frac{1}{2}\ln\left|u\right| + C

The minus comes from differentiating cosine and the half from the inner 22, so both signs and factors have a traceable source.

The equivalent secant form

12lncos2x=12lnsec2x-\frac{1}{2}\ln\left|\cos 2x\right| = \frac{1}{2}\ln\left|\sec 2x\right|

Answer keys use either. They differ only by the logarithm rule that a negative sign flips the argument to its reciprocal.

Common mistakes

  • Losing the 12\frac{1}{2}, which is the single most common slip on any inner coefficient.
  • Getting the sign backwards and writing 12lncos2x\frac{1}{2}\ln\left|\cos 2x\right|.
  • Dropping the absolute value, which is needed wherever cos2x\cos 2x 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 is the integral of tan 2x?

It is 12lncos2x+C-\frac{1}{2}\ln\left|\cos 2x\right| + C, equivalently 12lnsec2x+C\frac{1}{2}\ln\left|\sec 2x\right| + C.

Where does the one half come from?

From the inner derivative 22 in the substitution u=cos2xu = \cos 2x.