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!

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