Secant in terms of Tangent

Theorem
Let $x$ be a real number such that $\cos x \ne 0$.

Then:

where $\sec$ denotes the real secant function and $\tan$ denotes the real tangent function.

Proof
Also, from Sign of Secant:
 * If there exists integer $n$ such that $\paren {2 n - \dfrac 1 2} \pi < x < \paren {2 n + \dfrac 1 2} \pi$, then $\sec x > 0$.
 * If there exists integer $n$ such that $\paren {2 n + \dfrac 1 2} \pi < x < \paren {2 n + \dfrac 3 2} \pi$, then $\sec x < 0$.

When $\cos x = 0$, $\sec x$ and $\tan x$ is undefined.

Also see

 * Trigonometric Functions in terms of each other