TITLE: integrating the secant function, who figured this out?
QUESTION [10 upvotes]: I was looking at how the secant function is integrated.  The process is not obvious, and I don't expect it to be but I wanted to know if anyone knows who figured this out.  Here's what I'm talking about:
$$\begin{align*}\int \sec(x)dx
&=\int \sec(x)\cdot \frac{\sec(x)+\tan(x)}{\sec(x)+\tan(x)}dx\\
&=\int \frac{\sec^2(x)+\tan(x)\sec(x)}{\sec(x)+\tan(x)}dx.
\end{align*}$$
If $f(x) = \frac{1}{x}$, $g(x)=\sec(x)+\tan(x)$, $g'(x)=\sec^2(x)+\tan(x)\sec(x)$
Then $\int \sec(x)dx = \int f(g(x))\cdot g'(x)dx=\int \frac{1}{u}du$, where $u=g(x)$
$=\ln|\sec(x)+\tan(x)|+c$
So my question is, who first realised how to do this?  Who figured out step 2?  It's clever and not that obvious.
(and my sub-question is: why does Arturo insist on re-formatting my questions so that my first statements are centre aligned?! :)

REPLY [9 votes]: I don't know who might have come up with the method of integration about which you ask first; however, I have always regarded the method about which you are asking as a bit of reverse engineering. I think the following method utilizing a simple trig substitution and partial fractions is much more natural:
$$
\begin{align}
\int\sec(x)\;\mathrm{d}x
&=\int\sec^2(x)\;\mathrm{d}\sin(x)\\
&=\int\frac{1}{1-\sin^2(x)}\;\mathrm{d}\sin(x)\\
&=\int\frac12\left(\frac{1}{1-\sin(x)}+\frac{1}{1+\sin(x)}\right)\;\mathrm{d}\sin(x)\\
&=\frac12(\log(1+\sin(x))-\log(1-\sin(x)))+C\\
&=\frac12\log\left(\frac{1+\sin(x)}{1-\sin(x)}\right)+C\\
&=\frac12\log\left(\frac{(1+\sin(x))^2}{\cos^2(x)}\right)+C\\
&=\log\left(\frac{1+\sin(x)}{\cos(x)}\right)+C\\
&=\log(\sec(x)+\tan(x))+C\tag{1}
\end{align}
$$
Upon being presented with the result in $(1)$ without the derivation, one might differentiate to get
$$
\begin{align}
\frac{\mathrm{d}}{\mathrm{d}x}\log(\sec(x)+\tan(x))
&=\frac{\sec(x)\tan(x)+\sec^2(x)}{\sec(x)+\tan(x)}\\
&=\sec(x)\tag{2}
\end{align}
$$
and $(2)$ leads logically to the method about which you ask.