# Antiderivative of secant

(Yes, I’m bored. So why not completing my series.)

Antiderivative of tangent

First, remember that $\dfrac{d}{dx} \ln |x| = \dfrac{1}{x}$, so by chain rule we obtain $\dfrac{d}{dx} \ln |f(x)| = f'(x) \cdot \dfrac{1}{f(x)} = \dfrac{f'(x)}{f(x)}$. By the (first) fundamental theorem of calculus, derivative and antiderivative are two inverse operations, thus we obtain $\displaystyle\int \dfrac{f'(x)}{f(x)} \, dx = \ln |f(x)| + C$.

Also, recall that $\dfrac{d}{dx} \tan x = \sec^2 x$ and $\dfrac{d}{dx} \sec x = \sec x \tan x$. Don’t tell me you don’t know this; if you don’t, then stop reading.

To the real meat.

$\displaystyle\int \sec x \, dx$

$= \displaystyle\int \dfrac{\sec x (\tan x + \sec x)}{\tan x + \sec x} \, dx$ (!)

$= \displaystyle\int \dfrac{\sec^2 x + \sec x \tan x}{\tan x + \sec x} \, dx$

Letting $f(x) = \tan x + \sec x$, we have $f'(x) = \sec^2 x + \sec x \tan x$ (!). Thus,

$= \displaystyle\int \dfrac{f'(x)}{f(x)} \, dx$

Which by our lemma above is equal to

$= \ln |f(x)| + C$

$= \ln |\tan x + \sec x| + C$ (Hint: Wikipedia is your friend.)

Usually I stop here, but you can also simplify it to involve only one trigonometric function:

$\tan x + \sec x$

$= - \cot \left( x + \frac{\pi}{2} \right) + \dfrac{1}{\cos x}$

$= - \dfrac{1}{\tan \left( x + \frac{\pi}{2} \right)} + \dfrac{1}{\sin \left( x + \frac{\pi}{2} \right)}$ (!)

Call $a = \dfrac{x}{2} + \dfrac{\pi}{4}$. So

$= - \dfrac{1}{\tan 2a} + \dfrac{1}{\sin 2a}$

$= - \dfrac{1}{ \dfrac{2 \tan a}{1 - \tan^2 a} } + \dfrac{1}{2 \sin a \cos a}$

$= - \dfrac{1 - \tan^2 a}{2 \tan a} + \dfrac{\sec a}{2 \sin a}$

$= \dfrac{\tan^2 a - 1}{2 \tan a} + \dfrac{\sec a}{2 \sin a \cdot \frac{\cos a}{\cos a}}$

$= \dfrac{\tan^2 a - 1}{2 \tan a} + \dfrac{\sec a}{2 \cos a \cdot \frac{\sin a}{\cos a}}$

$= \dfrac{\tan^2 a - 1}{2 \tan a} + \dfrac{\sec^2 a}{2 \tan a}$

$= \dfrac{\tan^2 a - 1 + \sec^2 a}{2 \tan a}$

$= \dfrac{\tan^2 a + \tan^2 a}{2 \tan a}$ (remember $\tan^2 x + 1 = \sec^2 x$?)

$= \dfrac{2 \tan^2 a}{2 \tan a}$

$= \tan a$

$= \tan \left( \dfrac{x}{2} + \dfrac{\pi}{4} \right)$

Thus $\displaystyle\int \sec x \, dx = \ln \left| \tan \left( \dfrac{x}{2} + \dfrac{\pi}{4} \right) \right| + C$.

Now, what happens to $\displaystyle\int \sec^3 x \, dx$