Results 1 to 14 of 14

Math Help - Integral of 1/cosx

  1. #1
    Newbie
    Joined
    Oct 2010
    Posts
    2

    Integral of 1/cosx

    I've been struggling with the integral of 1/cosx
    I tried integration by parts but ended up with an even more complicated integral (xtanx/cosx)
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor

    Joined
    Aug 2006
    Posts
    18,712
    Thanks
    1642
    Awards
    1
    Have a look at this.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor matheagle's Avatar
    Joined
    Feb 2009
    Posts
    2,763
    Thanks
    5
    That's just sec x
    Just multiply and divide by sec x + tan x
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor
    Joined
    Oct 2008
    Posts
    1,034
    Thanks
    49
    Or use the Weierstrass sub. (Also see the cosec example above it, for step-by-step.)

    _________________________________________

    Don't integrate - balloontegrate!

    Balloon Calculus; standard integrals, derivatives and methods

    Balloon Calculus Drawing with LaTeX and Asymptote!
    Follow Math Help Forum on Facebook and Google+

  5. #5
    MHF Contributor
    Prove It's Avatar
    Joined
    Aug 2008
    Posts
    11,591
    Thanks
    1445
    In terms of sines and cosines:


    \displaystyle \int{\frac{1}{\cos{x}}\,dx} = \int{\frac{\sin{x}}{\cos{x}\sin{x}}\,dx}

    \displaystyle = -\int{\left(\frac{1}{\cos{x}\sqrt{1 - \cos^2{x}}}\right)(-\sin{x})\,dx}.


    Now make the substitution \displaystyle u = \cos{x} so that \displaystyle \frac{du}{dx} = -\sin{x} and the integral becomes

    \displaystyle -\int{\left(\frac{1}{u\sqrt{1 - u^2}}\right)\frac{du}{dx}\,dx} = -\int{\frac{1}{u\sqrt{1 - u^2}}\,du}

    \displaystyle = \int{\frac{1}{u^2}\left(-\frac{u}{\sqrt{1 - u^2}}\right)\,du}


    Now if you make the substitution \displaystyle s = \sqrt{1 - u^2} \implies u^2 = 1 - s^2 so that \displaystyle \frac{ds}{du} = -\frac{u}{\sqrt{1 - u^2}} then the integral becomes

    \displaystyle \int{\frac{1}{1 - s^2}\,\frac{ds}{du}\,du} = \int{\frac{1}{(1-s)(1+s)}\,ds}.


    Now applying partial fractions:

    \displaystyle \frac{A}{1 - s} + \frac{B}{1 + s} = \frac{1}{(1-s)(1+s)}

    \displaystyle \frac{A(1+s)+B(1-s)}{(1-s)(1+s)} = \frac{1}{(1-s)(1+s)}

    \displaystyle A(1+s)+B(1-s) = 1

    \displaystyle A+As + B-Bs = 1

    \displaystyle (A-B)s + A+B = 0s + 1

    \displaystyle A-B = 0 and \displaystyle A + B = 1

    \displaystyle A = B = \frac{1}{2}.

    So \displaystyle \frac{1}{(1-s)(1+s)} = \frac{1}{2(1-s)} + \frac{1}{2(1+s)} and

    \displaystyle \int{\frac{1}{(1-s)(1+s)}\,ds } = \frac{1}{2}\int{\frac{1}{1-s}\,ds} + \frac{1}{2}\int{\frac{1}{1 + s}\,ds}

    \displaystyle = -\frac{1}{2}\ln{|1-s|} + \frac{1}{2}\ln{|1+s|} + C

    \displaystyle = \frac{1}{2}(\ln{|1+s|} - \ln{|1-s|}) + C

    \displaystyle = \frac{1}{2}\left(\ln{\left|1 + \sqrt{1-u^2}\right|} - \ln{\left|1 - \sqrt{1 - u^2}\right|}\right) + C

    \displaystyle = \frac{1}{2}\left(\ln{\left|1 + \sqrt{1 - \cos^2{x}}\right|} - \ln{\left|1 - \sqrt{1 - \cos^2{x}}\right|}\right)+C

    \displaystyle = \frac{1}{2}\left(\ln{\left|1 + \sin{x}\right|} - \ln{\left|1 - \sin{x}\right|}\right)+C
    Last edited by Prove It; December 24th 2010 at 05:43 AM.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    MHF Contributor matheagle's Avatar
    Joined
    Feb 2009
    Posts
    2,763
    Thanks
    5
    That's wrong
    The derivative of the log of cosine isn't sec x
    It's -tan x
    Follow Math Help Forum on Facebook and Google+

  7. #7
    MHF Contributor Unknown008's Avatar
    Joined
    May 2010
    From
    Mauritius
    Posts
    1,260
    The error lies here:

    \displaystyle \frac{1}{2}\ln{\left|\frac{1+s}{1-s}\right|} \neq \frac{1}{2}\ln{|1-s^2|}
    Follow Math Help Forum on Facebook and Google+

  8. #8
    MHF Contributor
    Prove It's Avatar
    Joined
    Aug 2008
    Posts
    11,591
    Thanks
    1445
    Thanks, I got it. You answered mid-edit lol.

    My mistake was putting \displaystyle \int{\frac{1}{1-s}\,ds} = \ln{|1-s|} instead of \displaystyle -\ln{|1-s|}, which stuffed everything else up.
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Super Member

    Joined
    May 2006
    From
    Lexington, MA (USA)
    Posts
    11,751
    Thanks
    651
    Hello, e2718281!


    Pay no attention to the man behind the curtain . . .

    matheagle has the best solution.


    \displaystyle \int\frac{dx}{\cos x}

    \displaystyle \int\frac{dx}{\cos x} \;=\;\int \sec x\,dx \;=\;\ln|\sec x + \tan x| + C

    Follow Math Help Forum on Facebook and Google+

  10. #10
    MHF Contributor Unknown008's Avatar
    Joined
    May 2010
    From
    Mauritius
    Posts
    1,260
    But I am still curious about the solution that can be obtained, assuming that one doens't know that

    \displaystyle \int \sec x\,dx \;=\;\ln|\sec x + \tan x| + C

    I know that Prove It has gave one solution, except I can't seem to be able to bring \dfrac{1+\sin x}{1- \sin x} to become \sec x + \tan x.

    Or is it a matter of different constant of integration?
    Follow Math Help Forum on Facebook and Google+

  11. #11
    MHF Contributor

    Joined
    Aug 2006
    Posts
    18,712
    Thanks
    1642
    Awards
    1
    \sqrt {\dfrac{{1 + \sin (x)}}<br />
{{1 - \sin (x)}}}  = \sqrt {\dfrac{{\left( {1 + \sin (x)} \right)^2 }}<br />
{{\cos ^2 (x)}}}  = \dfrac{1}<br />
{{\cos (x)}} + \dfrac{{\sin (x)}}<br />
{{\cos (x)}}
    Follow Math Help Forum on Facebook and Google+

  12. #12
    Super Member
    Joined
    Mar 2010
    Posts
    715
    Thanks
    2
    1. How about this? Write:

    \displaystyle I =  \int \frac{1}{\cos{x}}\;{dx} = \int\frac{\cos{x}}{\cos^2{x}}\;{dx} = \int\frac{\cos{x}}{1-\sin^2{x}}\;{dx} = \int\frac{\cos{x}}{(1+\sin{x})(1-\sin{x})}\;{dx}.

    Put  \displaystyle t = \frac{1+\sin{x}}{1-\sin{x}} \Rightarrow \frac{dt}{dx} = \frac{2\cos{x}}{\left(1-\sin{x}\right)^2} \Rightarrow ~ dx = \frac{\left(1-\sin{x}\right)^2}{2\cos{x}}\;{dt}.

    Thus we have:

    \displaystyle I = \int\frac{\cos{x}}{(1+\sin{x})(1-\sin{x})}\cdot\frac{\left(1-\sin{x}\right)^2}{2\cos{x}}\;{dt} = \frac{1}{2}\int \frac{1-\sin{x}}{1+\sin{x}}}\;{dt} = \frac{1}{2}\int\frac{1}{t}\;{dt} = \frac{1}{2}\ln{t}+k.

    Therefore:

    \displaystyle \boxed{\int\frac{1}{\cos{x}}\;{dx} =  \frac{1}{2}\ln\bigg|\frac{1+\sin{x}}{1-\sin{x}}\bigg|+k}.
    Follow Math Help Forum on Facebook and Google+

  13. #13
    Super Member
    Joined
    Mar 2010
    Posts
    715
    Thanks
    2
    Notice that we could have done it without the substitution:

    \displaystyle I =  \int\frac{\cos{x}}{(1+\sin{x})(1-\sin{x})}\;{dx} = <br />
\frac{1}{2} \int\frac{\cos{x}}{1+\sin x}\;{dx}-\frac{1}{2} \int\frac{-\cos{x}}{1-\sin x}\;{dx}.

    Since the numerator of each integral is the derivative of its denominator, it's clear that:

     \displaystyle I = \frac{1}{2}\ln\left|1+\sin{x}\right|-\frac{1}{2}\ln\left|1-\sin{x}\right|+k = \frac{1}{2}\ln\bigg|\frac{1+\sin{x}}{1-\sin{x}}\bigg|+k.
    Follow Math Help Forum on Facebook and Google+

  14. #14
    MHF Contributor matheagle's Avatar
    Joined
    Feb 2009
    Posts
    2,763
    Thanks
    5
    I still prefer

     \int \sec x dx =\int \sec x \left({ \sec x +\tan x \over \sec x +\tan x}\right)dx

      =\int  \left({ \sec^2 x +\sec x\tan x \over \sec x +\tan x}\right)dx

    Now let   u= \sec x +\tan x
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. integral (0 to pi/2) cosx/sqrt(1+sin^2x) help?
    Posted in the Calculus Forum
    Replies: 1
    Last Post: July 29th 2010, 07:38 AM
  2. Integral of sqrt(1 + (cosx) ^ 2) ?
    Posted in the Calculus Forum
    Replies: 5
    Last Post: June 2nd 2010, 06:04 AM
  3. Integral of (sinx+cosx)^2
    Posted in the Pre-Calculus Forum
    Replies: 2
    Last Post: January 24th 2009, 06:41 AM
  4. Verify that √((1-cosx)/(1+cosx)) = (1-cosx)/|sinx|
    Posted in the Trigonometry Forum
    Replies: 3
    Last Post: December 10th 2008, 08:39 PM
  5. Definite integral of -cosx
    Posted in the Calculus Forum
    Replies: 1
    Last Post: December 7th 2008, 08:07 AM

Search Tags


/mathhelpforum @mathhelpforum