# Find the following integral: $\int {{{1 + \sin x} \over {\cos x}}dx}$

My attempt:

$\int {{{1 + \sin x} \over {\cos x}}dx}$,

given : $u = \sin x$

I use the general rule:

\eqalign{ & \int {f(x)dx = \int {f\left[ {g(u)} \right]{{dx} \over {du}}du} } \cr & {{du} \over {dx}} = \cos x \cr & {{dx} \over {du}} = {1 \over {\cos x}} \cr & so: \cr & \int {{{1 + \sin x} \over {\cos x}}dx = \int {{{1 + u} \over {\cos x}}{1 \over {\cos x}}du} } \cr & = \int {{{1 + u} \over {{{\cos }^2}x}}du} \cr & = \int {{{1 + u} \over {\sqrt {1 - {u^2}} }}du} \cr & = \int {{{1 + u} \over {{{(1 - {u^2})}^{{1 \over 2}}}}}du} \cr & = \int {(1 + u){{(1 - {u^2})}^{ - {1 \over 2}}}} du \cr & = {(1 - u)^{ - {1 \over 2}}} + u{(1 - {u^2})^{ - {1 \over 2}}}du \cr & = {1 \over {({1 \over 2})}}{(1 - u)^{{1 \over 2}}} + u - {1 \over {\left( {{1 \over 2}} \right)}}{(1 - {u^2})^{{1 \over 2}}} + C \cr & = 2{(1 - u)^{{1 \over 2}}} - 2u{(1 - {u^2})^{{1 \over 2}}} + C \cr & = 2{(1 - \sin x)^{{1 \over 2}}} - 2(\sin x){(1 - {\sin ^2}x)^{{1 \over 2}}} + C \cr & = {(1 - \sin x)^{{1 \over 2}}}(2 - 2\sin x) + C \cr}

This is wrong, the answer in the book is:

$y = - \ln |1 - \sin x| + C$

Could someone please explain where I integrated wrongly? Thank you!

-
$\cos^2x\rightarrow 1-u^2$, not $\sqrt{1-u^2}$. – Start wearing purple May 8 '13 at 17:56
Nice spot, thank you! I wasn't thinking straight! – seeker May 8 '13 at 17:57
That's a well-formed question. – The Chaz 2.0 May 8 '13 at 18:22

You replaced $\cos^2 x$ by $\sqrt{1-u^2}$, it should be $1-u^2$.

Remark: It is easier to multiply top and bottom by $1-\sin x$. Then we are integrating $\frac{\cos x}{1-\sin x}$, easy.

-
Except that mistake is the method right? – seeker May 8 '13 at 17:57
Yes, it is fine. You will immediately get the correct answer if you fix that step. – Milind May 8 '13 at 17:58
Looks like more of a comment. – Kaster May 8 '13 at 17:58
Sure, and it is ingenious. I would have divided and gotten integral of $\sec x+\tan x$. Easy then if you can quote the integrals, unpleasant otherwise. – André Nicolas May 8 '13 at 17:59
I am quoting you, copied and pasted directly apart from formatting change: $\int {{{1 + u} \over {{{\cos }^2}x}}du} = \int {{{1 + u} \over {\sqrt {1 - {u^2}} }}du}$ (fifth displayed line and sixth displayed line) – André Nicolas May 8 '13 at 18:31

Do this:

$\int { \frac { 1+\sin { x } }{ \cos { x } } dx } =\int { \frac { \left( 1+\sin { x } \right) \left( 1-\sin { x } \right) }{ \cos { x } \left( 1-\sin { x } \right) } dx= } \int { \frac { \cos { x } }{ \left( 1-\sin { x } \right) } } dx$

Then do the substitution rule

$\left( 1-\sin { x } \right) =u$

-
I see, nice trick! – seeker May 8 '13 at 18:02

Split the fraction, you get to integrate secx and tanx. Standard

-

Another approach (this is essentially the same as your $u=\sin(x)$ subsitution) \begin{align} \int\frac{1+\sin(x)}{\cos(x)}\,\mathrm{d}x &=\int\frac{1+\sin(x)}{\cos^2(x)}\,\mathrm{d}\sin(x)\\ &=\int\frac{1+\sin(x)}{1-\sin^2(x)}\,\mathrm{d}\sin(x)\\ &=\int\frac{\mathrm{d}\sin(x)}{1-\sin(x)}\\ &=-\log(1-\sin(x))+C \end{align}

-

There's an easier way: $$I = \int \frac{(1+\sin x)dx}{\cos x} = \int \frac{(1-\sin ^2 x)dx}{\cos x(1-\sin x)}=\int \frac{\cos x dx}{(1-\sin x)} = -\int \frac{d (1-\sin x)}{1-\sin x}$$ Denote $1-\sin x=t$ to get $$I=-\log |1-\sin x|+C_1$$

-

$$\int{(\frac {1}{\cos x}}+{\frac {\sin x}{\cos x})}dx$$

$$\int {(\sec x + \tan x)dx}$$

$$\int {\sec x dx} +\int {\tan x dx}$$

$$\log |(\sec x + \tan x)| - \log |\cos x|+C$$

$$\log \frac{ |(\sec x + \tan x)|}{|\cos x|}+C$$ from here you can get different version of answer.

-