How does sec-squared x equals 1 plus tan-squared x?

Let s = sin x; c = cos x.

By definition,

sec x = 1/cos x = 1/c; and

tan x = (sin x) / (cos x) = s/c.

We know, also, that s2 + c2 = 1.

Then, dividing through by c2, we have,

(s2/c2) + 1 = (1/c2), or

(s/c)2 + 1 = (1/c)2; in other words, we have,

tan2 x + 1 = sec2 x.