TITLE: Integrating $\sec^2 x$ from first principles
QUESTION [8 upvotes]: Is it possible to solve $\int \sec^2 x ~dx$ without knowing that $\frac{d}{dx}\tan x = \sec^2 x$?

REPLY [9 votes]: Use the trig identity for $\text{sec}^2x$ and write the expression in terms of $\text{sin }x$ and $\text{cos }x$:
$$
\int{\text{sec}^2x\text{ }dx}=\int{(\text{tan}^2x+1)\text{ }dx}=\int{\text{tan}^2x\text{ }dx}+\int{dx}=\int{\frac{\text{sin}^2x}{\text{cos}^2x}\text{ }dx}+\int{dx}
$$
Prepare for integration by parts:
$$
u=\text{sin }x~~~~~~~~~~du=\text{cos }x\text{ }dx~~~~~~~~~~dv=\frac{\text{sin }x}{\text{cos}^2x}\text{ }dx~~~~~~~~~~v=\frac{1}{\text{cos }x}
$$
Integrate by parts and simplify:
$$
\int{\frac{\text{sin}^2x}{\text{cos}^2x}\text{ }dx}+\int{dx}=\frac{\text{sin }x}{\text{cos }x}-\int{\frac{\text{cos }x}{\text{cos }x}\text{ }dx}+\int{dx}=\text{tan }x+C
$$