Simplifying a trigonometric identity Simplify $1 + \tan^2x$
My attempt:
$$\begin{align}1 + \tan^2x&\\
&= \frac{1}{1} + \frac{\sin^2x}{\cos^2x}\\
&= \frac{1(\cos^2x)}{1(\cos^2x)} +\frac{\sin^2x}{\cos^2x}\\
&=\frac{\cos^2x}{\cos^2x}+\frac{\sin^2x}{\cos^2x}\\
&=\frac{\cos^2x + \sin^2x}{\cos^2x\cos^2x}\\
&= \frac{\sin^2x}{\cos^2x}\\
&= \tan^2x\end{align}$$
The correct answer, however..is $sec^2x$ Wherever I went wrong, please show.

$$1 + \tan^2 x \implies \sec^2 x - \tan^2 x + \tan^2 x \implies \sec^2 x$$
