# Integration help for expectation of a function of a random variable

by trance_dude
Tags: expectation, function, integration, random, variable
 P: 3 1. The problem statement, all variables and given/known data Hello, have a stats question I am hoping you guys can help with. The expectation of a function g of a random variable X is: E[g(X)] = $$\int^{\infty}_{-\infty}$$ g(x)fx(x)dx where fx is the pdf of X. For example, the particular expectation I am considering right now is: E[g(X)] = $$\int^{-\infty}_{\infty}\frac{1}{1+ax^{2}}\cdot \frac{1}{\sqrt{2\pi}}$$$$e^{-x^{2} / 2}dx$$ this form of integral (i.e. containing that particular e term) must happen often whenever one takes the expectation of a function which depends on a normal random variable. In general, what is the best approach to solve such integrals in closed form here? Integration by parts? I know that the normal curve itself must be integrated using a "trick" such as switching to polar coordinates. Integration by parts might help me isolate the e term to do so, but actually in this case I am not making much progress using that method because the other (first) term has x in the denominator. Any thoughts as to a general approach and/or to this specific problem are much appreciated. thanks!
 P: 193 $$\frac{d}{dx}[tan^{-1}(ax)] = \frac{a}{1 + a^2x^2}.$$ Also, since we have $$e^{-x^2/2}$$, we're going to want a $$-x$$ in the numerator. We can get this in a crafty sort of way by multiplying by $$\frac{-x}{-x}$$. Can you finish from there? Spoiler Hint: You're going to have to do an integration by parts within an integration by parts.
 P: 193 Integration help for expectation of a function of a random variable hmm...now that I try it fully, that integral doesn't work out. Are you sure you copied down the problem correctly? If yes, then I'm assuming there's a typo because the answer WolframAlpha is giving is: $$\frac{\pi e^{\frac{1}{2a}} \ \ \ erfc(\frac{1}{\sqrt{2}\sqrt{a}})}{\sqrt{a}}$$, where erfc(z) is the complementary error function. It exists and I've read up on its definition; however, unless your teacher has mentioned it in class yet, I doubt it's the correct answer. Most likely, there's an error the problem you stated.