1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
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: Integrating Gaussian integral by parts

  1. Apr 25, 2013 #1
    1. The problem statement, all variables and given/known data

    We define [tex]I_{n} = \int_{-∞}^{∞}x^{2n}e^{-bx^{2}}dx[/tex], where n is a positive integer. Use integration by parts to derive:


    2. Relevant equations

    Parts formula.

    3. The attempt at a solution

    So I'm just stuck here, I'm baffled and confused. Firstly if I take the second term [tex]e^{-bx^{2}}[/tex] as my dv term then I cannot integrate it which in itself I don't understand. Clearly I have a lacking fundamental knowledge of calculus, why are there some functions such as this that we cannot integrate normally? My confusion is furthered by if I take the same term as my u then I am allowed to differentiate it normally and I can carry out the integration by parts but I get In crop up again and I'm going to end up in an infinite loop integrating by parts...

    Perhaps there is some trick or manipulation of the integral that I can use but it doesn't help the fact that I don't understand why the second term cannot be integrated etc.

    Any help on this would be much appreciated.
  2. jcsd
  3. Apr 25, 2013 #2


    User Avatar
    Science Advisor
    Gold Member

    You are correct in that you can't integrate the dv you have chosen. So choose another. Hint, when you try to integrate it (via variable substitution) what difficulties do you run into?

    [edit: Here is a classic counter example to the assertion "if you know you can't succeed you shouldn't try."]
  4. Apr 25, 2013 #3


    User Avatar
    Homework Helper
    Gold Member

    Use the following substitution:

    e-bx2dx = d(e-bx2)/(-2bx)
  5. Apr 25, 2013 #4


    User Avatar
    Homework Helper

    There are functions you can not integrate "normally" that is, they lack a primitive function in closed form.

    Write the integrand as ∫x2n-1 (xe-bx2)dx, and take xe-bx2=dv.

  6. Apr 25, 2013 #5
    Thank you for your reply, I know how to do the integral because I looked at the solution, there what was chosen was [tex]xe^{-bx^{2}}[/tex] as V' and [tex]x^{n}[/tex] as U.

    Now that I know that little 'trick', I can do the integral because now, for some reason, the integral of V' is allowed.

    My problem is, I don't understand how you know.. I thought I integrated [tex]e^{-bx^{2}}[/tex] correctly at first using bog standard integration techniques but only realised it was incorrect and couldn't be integrated for some reason when I used WolframAlpha to check it, but there is no WolframAlpha in an exam, only your brain!

    So I understand that I chose the wrong U initially and that'll put me in an infinite loop which is self evident, so you stop, but I don't understand how I'm supposed to know that picking [tex]e^{-bx^{2}}[/tex] as my V' is incorrect because the integral doesn't exist. WolframAlpha says it's so, but I don't understand why.

    It goes across the board too really, I don't understand where your bog standard integration (and differentiation possibly?) techniques break down or why.
  7. Apr 25, 2013 #6
    Please see my reply to jambaugh. I just don't understand this, I understand why the substitution is valid but not why this function can be differentiated but not integrated.

    Okay, I understand this, that there are functions that cannot be integrated "normally", and if you refer to my reply to jambaugh you'll see that that is the 'trick' which I gleaned from the solution! The issue however, is not that there exist functions that cannot be integrated "normally", it's identifying them..

    Are they supposed to be self-evident and I'm just being blind? How do I know something can't be integrated "normally"? Are there functions that cannot be differentiated "normally"?

    If so, again, how do I identify them?
  8. Apr 25, 2013 #7


    User Avatar
    Homework Helper
    Gold Member

    Which function? e-bx2? You can integrate it, but the result is expressed in terms of an unfamiliar function erf(x)
  9. Apr 25, 2013 #8
    But if I had e-bx I could just integrate it using chain rule and get -(e-bx)/b but with this function it doesn't work since (e-bx)/2bx isn't the integral of the function. I don't understand how I'm supposed to know on sight that certain functions cannot be integrated using this method, of course if I then differentiated the answer I wouldn't get the original function but that's after a check.
    Last edited: Apr 25, 2013
  10. Apr 25, 2013 #9


    User Avatar
    Homework Helper
    Gold Member

    Chain rule is for differentiation. You can differentiate -(e-bx)/b using the chain rule and show that it gives e-bx.

    In general there is no simple procedure to tell if a certain function can be integrated in terms of elementary functions.
  11. Apr 25, 2013 #10


    User Avatar
    Science Advisor
    Gold Member

    Did you go back and see where you had made the error? You said you thought you had done it correctly and you hadn't. That is part of the key to your inability to spot the correct path. What I'm seeing in your post is that you are having trouble navigating the landscape because you too often "teleport" to your destination via e.g. WolframAlpha. You have to walk the path on your own to see the landscape and get your intuition working on finding the correct path. As I said, trying even when you know you'll not succeed lets you see the details of why you must fail in one technique and that gives you better understanding of how to choose better paths.
    I'm a little unclear here. Choosing dV = the exponential part shouldn't "put you in an infinite loop" but stop you cold when you try to find V (really try instead of looking up erf.) You try integrating [tex]e^{ax^2}dx[/tex] by variable substitution and you see that not all of your differential is there. You need an x term which by coincidence you have too many of in your U choice. OK here's somnething, "I need an x in my dV and I got extra in my choice of U!" So let's back up and try a new U and dV choice with this in mind!

    Remember integration is "backwards" differentiation. You have a systematic way of differentiating standard functions and their sums products quotients powers and compositions. Then you have to "undo" this. Reverse problems are typically more difficult and potentially intractable...but that's how you invent new stuff like error functions and logarithms and fractional exponents.

    After all what does [itex]\sqrt{2}[/itex] mean? It just means whatever is the positive solution to [itex] x^2 = 2[/itex]. It is a name for the solution to the problem, not really the solution as such. But that plus knowing there is a number out there that solves it, and that you can get an arbitrarily close rational approximation lets you make use of this name for the solution. It is the name plus the context that allows you to put worth into saying [itex]\sqrt{2}[/itex] is indeed "the solution". My point here is likewise that you need to look at the context...closely, as in practice more problems without actually looking ahead and reading the last chapter.

    Treat every problem as if you had $20 riding on whether you made an error before you actually check your answer. In a sense you do as you are paying good cash money to go to school and if you don't actually learn you are wasting it. Teaching is leading the proverbial horse to water. You have to do the drinkin' yourself...and pay attention enough along the way to find your own water when the time comes.

    To get away from analogies and to the point, you need to work more prior problems to this one to build up your skills and experience. You say you made an error and did not realize it. That is KEY! You need to recognize your errors before you "check the back of the book" and that's just practice practice practice practice practice. Especially you should work a type of problem until you can work it correctly and then work 5, no less than 5 similar problems of that type counting after you think you understand the method. If you get all five right without having to go back and repair (excepting maybe a minor arithmetic oversight) then you can move on. And that of course takes time. But as the methods of calculus build you get plenty of opportunity to practice the methods of the previous test or the previous semester. Don't skip these...e.g. don't use integral tables on intermediate steps if you have sufficient time to work it out for yourself.

    Whew! Sorry, I got up on my soap box and was preaching to you, but mean it as much or more for my own calc students. Sorry if I got to beating the pulpit too hard but I hope you'll take this as advice for a broad audience from which you are to take what help applies to you directly.
  12. Apr 25, 2013 #11
    I apologise I haven’t been as clear as I should have been from the outset but thank you for your reply. I understand what you are saying about practise and not relying on solutions or WolframAlpha but my specific problem in this case was that I tried to solve the integral by parts, and initially chose dV as the exponential part and just like you said, got stuck. I tried to integrate it using “reverse chain rule” in the same fashion I’d just integrate something like e^-2x on sight as -0.5e^-2x. I got my value for V to be (e^-(bx^2))/(2bx) which I tried to use in my parts formula along with dV, U, & dU but I got myself into a nasty mess and it wasn’t working. That’s why I used WolframAlpha to check the value of the integral of V and to my astonishment it wasn’t what I thought it was and I couldn’t understand why. Admittedly I was just going through the motions or the “usual” way for integrating an exponential because I’ve not come across a case like this where it just “doesn’t work”, this is been my real issue and problem. Of course then I tried switching my selection of dV and U so I could avoid integrating the exponential which is what I was referring to when talking of the “infinite loop”, where I’d tried again this time selecting the non-exponential term as my dV. In this case I got what was self-evidently an “infinite loop” since the initial integral I_n cropped up again and so it would keep coming up. It’s here that I peeked at the outline solution and noticed selecting dV = exponential*x, I understood why this worked and could see the value of V straight away by thinking about differentiating the exponential part and compensating for constants to give V = -(e^-(bx^2))/2b which I then used in the parts formula and got my relation algebraically.

    I understand what you’re saying about practise etc and I will try to work on that as best I can, however my mistake was thinking I could Integrate dV = e^-(bx^2) on sight to give V = (e^-(bx^2))/(2bx), when I told a friend about my confusion he also thought this was the correct way to do it to which I replied that if you differentiate V you don’t get dV. Perhaps we were just taught or simply assumed that we could apply this “method” to all exponential integrals. I’m not sure I’ve done a good job explaining what my confusion is but everyones replies have still helped a lot! Thank you!

    Also “bog” is just completely ignorable British slang, “bog standard” ~ “standard”.

    I'm not sure what it's called, maybe "reverse chain rule" then, but if I have a function e^ax to differentiate it I just have (e^ax)* d/dx(ax) = ae^ax, and the way I was taught was that you can do the same for integration but just divide by the derivative of ax.

    So, to integrate e^ax I just have (e^ax)/ [d/dx(ax)] = (e^ax)/a

    What I think I'm beginning to understand is that this "method" works for differentiating (e^(ax^n)), where n = ±(1,2,3,...) but it doesn't work for integrating (e^(ax^n)), where n = ±(1,2,3,...)
    Last edited: Apr 25, 2013
  13. Apr 25, 2013 #12


    User Avatar
    Science Advisor
    Gold Member

    I understand. And as I said, I'm preaching more to my frustration with my students so take what you find useful in my comments.

    Let's look at your integration of [itex]e^{-bx^2}[/itex] in detail. You said
    A key focus here for you is to distinguish a taking the derivative with taking the differential.

    dV is the differential of a variable expression and so as such should be a function times the differential of the independent variables. [itex]dV = V' dx[/itex]. There is a great deal of knowledge encoded in the notation, trust and be true to the notation. Your [itex] dV = e^{-bx^2}[/itex] is notationally incorrect. There should be, must be a differential factor on the R.H.S.

    This affects how you "visually integrate". You use [itex]dV = e^u du [/itex] equates to [itex]V = e^{u}[/itex].
    In the simple cases where e.g. u=ax you note [itex] \int e^{ax} dx = 1/a e^{ax}[/itex] and use that straight away as an antiderivative formula. But look at the differentials and view it as a differential formula. Really integrals are "anti-differentials" not anti-derivatives in that [itex]\int du = u + c[/itex]. That then is why we keep those pesky dx's and dt's in the integral notation. It is only through the differential chain rule that we get anti-derivatives from these anti-differentials.

    With that understanding you can view the 1/a part of the anti-derivative as the constant factor missing in the needed differential to take the anti-differential of [itex]e^{ax}dx[/itex]. Now with that understanding when you hit upon the differential [itex] e^{-bx^2}dx[/itex] you see not a missing constant factor but a missing variable factor. It is not simply that you must "multiply by 1 over the derivative of the exponent" because that "rule" doesn't generalize. It is that you must match up the two differentials:
    [itex] e^{-bx^2}dx[/itex] and [itex]d (some function)[/itex].

    It is the same kind of conceptual mistake as when one forgets the negative solution of [itex]x^2 = 2[/itex] when they write down [itex]\sqrt{2}[/itex]. That is in habitually working in a limited context they shortcut conceptually and incorrectly generalize: "[itex]\sqrt{2}[/itex] is 'the square root of 2'" (emphasis on 'the') equates to "[itex]\sqrt{2}[/itex] is the root of the equation [itex]x^2 = 2[/itex].

    For you the analogue is in solving for the anti-derivative of the exponential of a constant multiple of a variable and the more general problem of finding the anti-derivative of the exponential of some function of that variable. (That is specifically for your one error.)
    The rest of what I'm saying isn't so much about making errors as understanding the distinctions and notations better to better see your path to solutions.

    I'm trying to answer what I perceive as a "How was I supposed to know" question here. I hope I've been helpful. I think many teaching differential calculus don't pay enough attention or provide enough instruction on this. I hit my students with both differentials and derivatives as soon as possible so they can begin making mistakes and through the correction of those mistakes have a better understanding of each and their distinctions by the time we get to integration.

    Remember confusion is not bad, it is a symptom you don't yet understand. It is far better to feel confused than to feel you know something when you actually don't. Just see it as a flag indicating "Attention to details needed here!". It is the natural first step to understanding. You simply must be audacious and not let it devolve into frustration.
  14. Apr 25, 2013 #13
    jambaugh, thank you so much! This is the sort of answer I was looking for, I understand I didn't make it clear what I was confused about because I didn't entirely know myself. I am beginning to understand thanks to your great explanation what it is that I've been doing and adopted as a general rule when it isn't one. Although It's still a little confusing, i.e. the difference between a differential and a derivative, I can see what needs to be done and what I need to focus on now to get better!

    Thank you very much!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted