∫ tan x dx = −ln|cos x| + C = ln|sec x| + C.

Quick Scoop

Here’s the idea in simple steps:

  1. Rewrite tan x.
    • Use the identity tan x = sin x / cos x.
  1. Set up the integral.
    • ∫ tan x dx = ∫ (sin x / cos x) dx.
  1. Use substitution.
    • Let u = cos x, then du = −sin x dx, so −du = sin x dx.
 * The integral becomes ∫ (sin x / cos x) dx = ∫ (1/u)(−du) = −∫ (1/u) du.
  1. Integrate.
    • −∫ (1/u) du = −ln|u| + C.
 * Substitute back u = cos x → −ln|cos x| + C. 
  1. Alternate form.
    • Because −ln|cos x| = ln|sec x|, you can also write the answer as:
      ∫ tan x dx = ln|sec x| + C.

So, the standard result used in calculus is:

  • ∫ tan x dx = −ln|cos x| + C, or equivalently,
  • ∫ tan x dx = ln|sec x| + C.

TL;DR: The integration of tan x is a logarithmic function: −ln|cos x| + C or ln|sec x| + C.

Information gathered from public forums or data available on the internet and portrayed here.