Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Hard integral

  1. Mar 1, 2009 #1
    1. The problem statement, all variables and given/known data

    [tex]
    \int_{0}^{\pi/4} \exp \left(-\frac{1}{\cos^2x}\right)\mbox{d}x
    [/tex]



    3. The attempt at a solution
    Can someone give me a hint? I don't see a smart substitution nor a path via integration by parts...
     
  2. jcsd
  3. Mar 1, 2009 #2
    Last edited by a moderator: May 4, 2017
  4. Mar 1, 2009 #3

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    You are right. Plouffe's inverter is not all powerful. It only knows about numbers it's happened to have heard about. But there is a reasonably simple expression. You do need the erf function. Write the integral as exp(-a*sec(x)^2). Find d/da of that. Now THAT function you can integrate dx from 0 to pi/4 (in terms of erf). You can in turn integrate that expression da. And you know the value if a=0. It's not terribly simple, to find the constant of integration you need to figure out things like lim a->0 erf(sqrt(a))/sqrt(a). But it can be done. You might want to put (pi/4)*(1-erf(1)^2) into Plouffe's inverter.
     
    Last edited by a moderator: May 4, 2017
  5. Mar 2, 2009 #4
    [tex]

    \frac{d}{da}\ \left[ \int_{0}^{\pi/4} \exp \left(-a \cdot \sec^2 (x) \right) \mbox{d}x \right ] = \int_{0}^{\pi/4} - \sec^2(x) \cdot \exp \left(-a \sec^2 x\ \right) \mbox{d}x

    [/tex]

    hmmm...I don't see how because:

    [tex] \operatorname{erf}(x) = \frac{2}{\sqrt{\pi}}\int_0^x e^{-t^2} dt. [/tex]
     
  6. Mar 2, 2009 #5

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    Be creative! You have to be. This whole problem is about trickyness. sec(x)^2=1+tan(x)^2. Now substitute t=sqrt(a)*tan(x). You know there is an answer. I sketched the route. I even gave you a really strong hint what the answer was. Try and figure out one or two of the non-obvious steps without the need for a hint.
     
    Last edited: Mar 2, 2009
  7. Mar 2, 2009 #6
    [tex]
    \frac{dI}{da}=\int_{0}^{\pi/4} - \sec^2(x) \cdot \exp \left(-a \sec^2 x\ \right) \mbox{d}x = ( -e^{-a}) \cdot \int_0^{\pi /4} \sec^2(x) \cdot \exp (-a \tan^2 x )\ \mbox{dx}

    [/tex]


    Now with

    [tex] t =\sqrt{a} \tan(x) \longrightarrow t^2 = a \tan^2(x) [/tex]

    and

    [tex] dt = \sqrt{a} \sec^2(x) [/tex]



    I get:

    [tex] \frac{dI}{da} = \frac{-e^{-a}}{ \sqrt{ a} } \cdot \int_0^{ \pi /4} e^{-t^2} \mbox{d}t =\frac{-e^{-a}}{ \sqrt{ a} } \cdot \mbox{erf} ( \pi /4) [/tex]
     
  8. Mar 2, 2009 #7

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    Not quite. The argument of the erf is t. t isn't equal to tan(x). Now keep going.
     
  9. Mar 2, 2009 #8
    This isn't the most easy integral I tackled :rolleyes:

    Ok, so the boundaries are wrong (that's what you meant in your last post, right Dick?)


    [tex]
    \frac{dI}{da} = \frac{-e^{-a}}{ \sqrt{ a} } \cdot \int_0^{ \sqrt{a}} e^{-t^2} \mbox{d}t =\frac{-e^{-a}}{ \sqrt{ a} } \cdot \mbox{erf} ( \sqrt{a})
    [/tex]

    right?
     
  10. Mar 2, 2009 #9

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    You are getting there. There's also a 2/sqrt(pi) in the erf definition. What happened to that?
     
  11. Mar 2, 2009 #10
    [tex]

    \frac{dI}{da} = \frac{-e^{-a}}{ \sqrt{ a} } \cdot \int_0^{ \sqrt{a}} e^{-t^2} \mbox{d}t = \left( \frac{ \sqrt{ \pi}}{2} \right) \left( \frac{-e^{-a}}{ \sqrt{ a} } \right) \cdot \mbox{erf} ( \sqrt{a})

    [/tex]
     
  12. Mar 2, 2009 #11

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    Good. Now can you integrate that da? It's creative time. It's not NEARLY as hard as it looks. Think u substitution.
     
  13. Mar 3, 2009 #12
    Now with [tex]u=\sqrt{a}[/tex]

    I get:

    [tex] \int \left( \frac{ \sqrt{ \pi}}{2} \right) \left( \frac{-e^{-a}}{ \sqrt{ a} } \right) \cdot \mbox{erf} ( \sqrt{a}) \mbox{d}a =\int (-\sqrt{ \pi}) \cdot e^{-u^2} \cdot \mbox{erf} (u)\ \mbox{d}u = C \cdot \int \int e^{u^2-t^2}\ \mbox{d}t \mbox{d}u
    [/tex]

    This is getting nasty...
     
  14. Mar 3, 2009 #13

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    If u=erf(sqrt(a)), what's du? Or since you've already done that u substitution for sqrt(a), if v=erf(u), what's dv?
     
  15. Mar 3, 2009 #14
    Of course! The derative of erf(v) is e-v2 !

    But then

    [tex] \int \left( \frac{ \sqrt{ \pi}}{2} \right) \left( \frac{-e^{-a}}{ \sqrt{ a} } \right) \cdot \mbox{erf} ( \sqrt{a}) \mbox{d}a =\int (-\sqrt{ \pi}) \cdot e^{-u^2} \cdot \mbox{erf} (u)\ \mbox{d}u = C_1 \cdot \mbox{erf} (u) + C_2

    [/tex]


    With the very important integration constant C2, right?
     
  16. Mar 3, 2009 #15

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    Dead right, but don't forget the sqrt(pi) and 2 parts of the erf definition. That's why it's actually an easy integral. But doing the v=erf(u) substitution turns the integral into v*dv, right? What's that? And there's no 'integration constant' C1. You know what C1 is. C2 is important, yes.
     
  17. Mar 4, 2009 #16
    Right, I'll try again:

    [tex]
    \int \left( \frac{ \sqrt{ \pi}}{2} \right) \left( \frac{-e^{-a}}{ \sqrt{ a} } \right) \cdot \mbox{erf} ( \sqrt{a}) \mbox{d}a =\int (-\sqrt{ \pi}) \cdot e^{-u^2} \cdot \mbox{erf} (u)\ \mbox{d}u = (\sqrt{ \pi}) \frac{ \sqrt{\pi} }{2} \int v\ \mbox{d}v = \frac{1}{4} \pi v^2 +C_0
    [/tex]


    I previously used C_1 to 'hide' all constants but I didn't specify that, C_0 is here the constant of integration multiplied by some factor. Is this correct, Dick?
     
  18. Mar 4, 2009 #17

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    You forgot the minus sign. So you've got -pi*erf(sqrt(a))^2/4+C. Now how to determine C?
     
  19. Mar 7, 2009 #18
    If a = 0 then


    [tex]

    \int_{0}^{\pi/4} \exp \left(-\frac{a}{ \cos^2x}\right)\mbox{d}x = \frac{ \pi}{4}

    [/tex]



    So I conclude that:

    [tex] \frac{\pi}{4} = \left( \frac{- \sqrt{\pi}}{2} \right) \cdot \lim_{a \rightarrow 0} \int e^{-a} \cdot \frac{ \mbox{erf} (\sqrt{a}) }{\sqrt{a}}\ \mbox{d}a [/tex]
     
  20. Mar 7, 2009 #19

    gabbagabbahey

    User Avatar
    Homework Helper
    Gold Member

    Right, but for all [itex]a[/itex] you just showed

    [tex]\int_{0}^{\pi/4} \exp \left(-\frac{a}{ \cos^2x}\right)\mbox{d}x = \frac{1}{4} \pi \mbox{erf}(\sqrt{a})^2 +C_0[/tex]


    Not a very useful conclusion; try solving for [itex]C_0[/itex] instead.

    What is [tex] \frac{1}{4} \pi \mbox{erf}(\sqrt{a})^2 +C_0[/tex] for a=0?
     
  21. Mar 7, 2009 #20
    So [tex]C_0 =0[/tex]
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook