# Proof of formula for the antiderivative of $\sec x$ [duplicate]

How do I prove that indefinite integral of $\sec x$ is equal to $\ln(\sec x + \tan x) + C$?

I tried to substitute $t = \cos x$ but that didn't help. I have no idea how to integrate it any other way, and my textbook doesn't offer a derivation.

• Note that this is an historically famous integral, and for that reason you can find PLENTY of information about it on the net. – David H Oct 15 '14 at 6:57
• This particular indefinite integral is of significant historical interest too---by construction an antiderivative of $\sec x$ is the function that maps a latitude to its corresponding vertical coordinate in the Mercator projection. Thanks to its conformality and another basic feature, this projection has the property that constant compass headings correspond to straight lines on the projection, which makes it especially useful for navigation. – Travis Willse Oct 15 '14 at 6:58
• This may be a cheap way out, but: As you already know the supposed answer, simply calculate the derivative of that and prove that you get $\sec x$ as the answer. – PhoemueX Oct 15 '14 at 7:41

$$\sec x=\frac1{\cos x}=\frac{\cos x}{\cos^2x}=\frac{\cos x}{1-\sin^2x}$$ Substitute $u=\sin x$ and use the method of partial fractions.

Since $$\frac1{1-u^2}=\frac12\left(\frac1{1+u}+\frac1{1-u}\right)$$ we get $$\int\sec xdx=\int\frac{du}{1-u^2}=\frac12(\ln(1+u)-\ln(1-u))=\ln\sqrt{\frac{1+u}{1-u}}.$$ Now $$\frac{1+u}{1-u}=\frac{1+\sin x}{1-\sin x}=\frac{(1+\sin x)^2}{1-\sin^2x}=\frac{(1+\sin x)^2}{\cos^2x}=\left(\frac{1+\sin x}{\cos x}\right)^2=(\sec x+\tan x)^2$$ so $$\int\sec xdx=\ln\sqrt{\frac{1+u}{1-u}}=\ln\sqrt{(\sec x+\tan x)^2}=\ln|\sec x+\tan x|.$$

• i tried doing this, as the result i got ln(cosx) – Sk Dayn Oct 15 '14 at 8:03
• Thanks ! I forget about the minus sign for ln(1-u) – Sk Dayn Oct 15 '14 at 9:17

As Travis noted, differentiation is the best way to do this.

But strangely enough, this very question was an important open question in the mid-17th century (before the invention of Calculus). See e.g. this web page of mine

• This page is a great resource, Robert. Recovering the Mercator projection is one of my favorite problems to assign to integral calculus students. – Travis Willse Oct 15 '14 at 7:02
• Seems to me this is a comment rather than an answer, besides being spam. Very interesting, though, so I won't flag it. :-) – bof Oct 15 '14 at 7:06
• Very nice page ! Thanks for providing it ! – Claude Leibovici Oct 15 '14 at 8:22

It's typically very easy to verify whether a function $F(x)$ is an antiderivative of a function $f(x)$; by definition, you need only check that $$F'(x) = f(x).$$

In this case, on, say, $\left(-\frac{\pi}{2}, \frac{\pi}{2}\right)$, $$\frac{d}{dx} \log(\sec x + \tan x) = \frac{\frac{d}{dx}(\sec x + \tan x)}{\sec x + \tan x} = \frac{\sec x \tan x + \sec^2 x}{\sec x + \tan x} = \frac{(\sec x + \tan x) \sec x}{\sec x + \tan x} = \sec x,$$ and so (by definition) $$\int \sec x \, dx = \log |\sec x + \tan x| + C.$$ (Here the absolute value signs simply account for the possibility that you're integrating over an interval on which $\sec x + \tan x < 0$, and you can justify this formula by using the identities $\sec(x + \pi) = -\sec x$ and $\tan (x + \pi) = \tan x$.)

Hint: Write $$\sec x = \sec x \left(\frac{\sec x + \tan x}{\sec x + \tan x}\right)$$ and remember what the derivatives of $\sec x$ and $\tan x$ are.

• I hate this so-called derivation. The only motivation for multiplying and dividing by $\sec x+\tan x$ is that you know how it's going to work out, in which case you might as well just start with $\ln(\sec x+\tan x)$ and differentiate. – bof Oct 15 '14 at 7:04
• Well, it's just a matter of opinion. Each non-trivial integral requires some trick which will seem obvious once we know the answer. I like your method by the way +1. – hjhjhj57 Oct 15 '14 at 7:13
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}