Sign up ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I can't find what's wrong in my attemp on finding the integral of $f(x)=\sec(x)$

$$\int \sec(x) dx = \int \frac{dx}{\cos(x)} = \int \frac{\cos(x)dx}{\cos^2(x)}=\int\frac{\cos(x)dx}{1-\sin^2(x)}$$ $$\sin(x) = u \\\\\\\\\\\ du = \cos(x) dx$$ $$\int \frac{du}{1-u^2}=\int \frac{A}{1+u} du + \int \frac{B}{1-u} du = \int\frac{A(1-u) B(1+u)}{1-u^2}du$$ $$ A=B=\frac{1}{2} $$ $$\frac{1}{2}\int \frac{1}{1+u} du + \frac{1}{2}\int \frac{1}{1-u}du= \frac{1}{2}(\ln(1+\sin(x))+\ln(1-\sin(x))$$

share|cite|improve this question
Preceed $sec$, $sin$, $cos$ and $ln$ with a \ to get $\sec,\dots ,\ln$. – Git Gud Feb 26 '13 at 23:02

1 Answer 1

up vote 6 down vote accepted

The integral of $\dfrac{1}{1-u}$ is $-\ln(|1-u|)$. You left out the minus sign in front. (This comes in principle from the substitution $t=1-u$.)

Remark: Since differentiation is so easy, it is useful to scan a conjectured antiderivative for correctness. For example, that's the way I would integrate $\sin(1+3t)$. The answer is something like $\cos(1+3t)$. Differentiate. We get $-3\sin(1+3t)$, wrong. Easy fix, multiply by $-\frac{1}{3}$.

share|cite|improve this answer
Oh, that was dumb! Thanks you very much! While we are at it, any general ideas on how to go from my result to $\ln(\sec(x)+\tan(x))$ ? – milo Feb 26 '13 at 23:15
$\ln(1+\sin(x))-\ln(1-\sin(x)=\ln(\frac{1+\sin(x)}{1-\sin(x)})=\ln(\frac{(1+\sin‌​(x))^{2}}{1-\sin^{2}(x)})=\ln(\frac{(1+\sin(x))^{2}}{\cos^{2}(x)})=2\ln(\frac{1+ \sin(x)}{\cos(x)})$ – Daniel Littlewood Feb 26 '13 at 23:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.