Integrating $\sec^2 x$ from first principles Is it possible to solve $\int \sec^2 x ~dx$ without knowing that $\frac{d}{dx}\tan x = \sec^2 x$?
 A: Here is an approach. First, note that
$$ \sec(x)=\frac{2}{e^{ix}+e^{-ix}}, $$
then use the substitution $u=e^{ix}$ to evaluate the integral. 
A: Show that for all $t_i \in x_i-x_{i-1}$ where the $x_i$ are partition points in $J=[a,b]$, $\forall \epsilon > 0$, there exists a $\delta$ such that while $\max{\left(x_i-x_{i-1}\right)}<\delta$  we have, $$\left|\sum_{i=0}^{\infty} \sec^2(t_i)(x_i-x_{i-1})-(\tan(b)-\tan(a))\right| < \epsilon $$
EDIT
As Kcd points out, $J$ must be chosen appropriately, so that no where in $J$ does $\sec^{2}{x}$ "blow up", otherwise the FTC would not hold. How, you might ask, would one come to the conclusion that one should ought to prove this? Well for an appropriately small mesh, $\max{(x_i-x_{i-1})}$,  one might notice that
$$
\sum_{i=1}^{N}\sec^{2}{t}(x_i-x_{i-1}) \approx \tan{b} - \tan{a} 
$$
A: Yes, this can be done, but the method is far longer than if you know the derivative of $\tan x$ already.  The point is to convert this trigonometric integral into the integral of a rational function, integrate that with partial fractions, and then convert back. We use the substitution $u = \tan(x/2)$, for which 
$$
\sin x = \frac{2u}{1+u^2}, \ \ \ \cos x = \frac{1-u^2}{1+u^2}, \ \ \ dx = \frac{2\,du}{1+u^2}.
$$
(This is called the $\tan(x/2)$-substitution, and is discovered naturally by comparing the trigonometric parametrization of the unit circle and a rational parametrization of the unit circle. See http://en.wikipedia.org/wiki/Tangent_half-angle_substitution.) 
[EDIT: Let me show how to derive those transformation formulas above, especially the one for $dx$ since there is a comment on my answer that it depends on knowing the derivative of $\tan x$ is $\sec^2 x$ already, but that's not really the case. We do need to know that $1 + \tan^2 t = \sec^2 t = 1/\cos^2 t$. Then $\cos^2(x/2) = 1/(1+\tan^2(x/2)) = 1/(1+u^2)$, so from the double-angle formulas for sine and cosine we get
$$
\cos x = 2\cos^2(x/2) - 1 = 2\sec^2(x/2) - 1 = \frac{2}{1+u^2} - 1 = \frac{1-u^2}{1+u^2}
$$
and
$$
\sin x = 2\sin(x/2)\cos(x/2) = 2\tan(x/2)\cos^2(x/2) = \frac{2u}{1+u^2}.
$$
Then differentiate both sides of the equation for $\sin x$ using the quotient rule on the right:
$$
\cos x\,dx = \frac{2(1+u^2)-(2u)(2u)}{(1+u^2)^2}\,du = \frac{2(1-u^2)}{(1+u^2)^2}\,du \Rightarrow dx = \frac{2\,du}{1+u^2}.
$$
]
From the formula for $\cos x$ in terms of $u$ we have $\sec^2 x = 1/\cos^2 x = (1+u^2)^2/(1-u^2)^2$, so 
$$
\int \sec^2 x \,dx = \int \frac{(1+u^2)^2}{(1-u^2)^2}\frac{2}{1+u^2}\,du = \int \frac{2(1+u^2)}{(1-u^2)^2}\,du.
$$
The partial fraction decomposition of that last integrand is 
$$
\frac{2(1+u^2)}{(1-u^2)^2} = \frac{2(1+u^2)}{(1-u)^2(1+u)^2} = \frac{1}{(1-u)^2} + \frac{1}{(1+u)^2}, 
$$
so
\begin{eqnarray*}
\int \sec^2 x\,dx & = & \int\left(\frac{1}{(1-u)^2} + \frac{1}{(1+u)^2}\right)\,du \\ 
& = & \frac{1}{1-u} - \frac{1}{1+u} + C \\
& = & \frac{2u}{1-u^2} + C \\
& = & \frac{2\tan(x/2)}{1 - \tan^2(x/2)} + C.
\end{eqnarray*}
Recall now the addition formula for the tangent function: 
$$\tan(a+b) = \frac{\tan a + \tan b}{1-(\tan a)(\tan b)}.$$ Thus the double-angle formula is $\tan(2a) = 2(\tan a)/(1 - \tan^2 a)$. Therefore, using $a = x/2$, we get
$$
\int \sec^2 x\,dx = \tan\left(2\frac{x}{2}\right) + C = \tan x + C.
$$
A: 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
$$
A: What if you write the numerator as $\sin^{2}(x) + \cos^{2}(x)$ and split the fraction? To integrate $\tan^{2}(x)$ you can add and subtract 1 to obtain a tangent as part of your anti derivative. The "subtraction" of 1 cancels against the second fraction after the split.
