# Notation pedantry (integration by substitution)?

In a summative assessment, I lost a mark due to this:

$$f_X(x)=\frac{\lambda}{\sqrt{2\pi}}\int_{-\infty}^\infty y^2\exp\left\{-\left(\frac{1}{2}+\lambda x\right)y^2\right\} \; dy$$

Now let $a=\frac{1}{2}+\lambda x$ for brevity and $u=ay^2$ so $du=2ay \; du$

Then

$$f_X(x)=\frac{2\lambda}{\sqrt{2\pi}}\int_0^\infty \frac{u}{a} e^{-u} \; du.$$

The comment was "show that you have considered any possible change in limits", and "y=" and "u=" were inserted into my script, so that it now reads:

$$f_X(x)=\frac{\lambda}{\sqrt{2\pi}}\int_{y=-\infty}^{y=\infty} y^2\exp\left\{-\left(\frac{1}{2}+\lambda x\right)y^2\right\} \; dy$$

Then

$$f_X(x)=\frac{2\lambda}{\sqrt{2\pi}}\int_{u=0}^{u=\infty}\frac{u}{a} e^{-u} \; du.$$

This is not a calculus module (it's statistical theory, final year undergraduate), and I feel pretty hard done by ! Is this overly pedantic on the part of the marker ?

EDIT, rather than correct the typos in this post, which would obscure robjohn's answer, I have posted an answer which (hopefully) doesn't contain any typos and makes the point more clearly.

-
What I would complain about is that you wrote $\exp-(1/2 +\lambda x)y^2$ while, as is it seems, you wanted to write $\exp(-(1/2 +\lambda x)y^2)$. I would not change your mark because of this, though. – user20266 Mar 31 '12 at 11:55
@Thomas, sorry, yes, a stupid typo. Please see my "answer" below. – P Sellaz Apr 1 '12 at 9:58
@PSellaz: I think you should speak with your instructor and/or the marker. They are setting the marking scheme for this class, and you need to have a better sense of their expectations than you have. Our opinions here are not terribly relevant. (I haven't looked at your specific work, so this is far from an answer.) – Sam Lisi Apr 1 '12 at 11:48
Please: Don't write \text{exp}. Write \exp. The latter not only prevents italicization, but provides proper spacing before and after "exp", thus: $a\exp b$. \exp is a standard operator name. – Michael Hardy Apr 1 '12 at 17:22

Your marker was not suggesting that you should write the $y=$ and $u=$ signs on the integrals (I like to do that myself, but there's no reason you should as it's perfectly clear from the $d y$ and the $du$ that those are the variables being integrated over). Rather, (s)he was trying to point out that you should have inserted an extra step noting explicitly that $y=\infty$ corresponds to $u=\infty$ and that $y=-\infty$ corresponds to $u=0$ - considering that this is an undergraduate course, I don't really see why you should have put this in since it seems perfectly clear and you did put the right limits into the integrals, so I would feel a little hard done by as well.

-
Thanks. I agree that it's quite a useful thing to do, to avoid making errors with the limits. In fact I might take up the habit of doing it, for this very reason ! Writing a line to explain the new limits seems reasonable but hardly /essential/ in a module like this. Another reason I think the marking is pointlessly strict is that I can't recall this has never been mentioned in a lecture, nor is it done anywhere in the lecture notes. – P Sellaz Mar 31 '12 at 11:57
Yes - it does seem pointlessly strict. You might want to think about showing the script to your lecturer or someone, just in case there's some other reason you lost that mark. – Donkey_2009 Mar 31 '12 at 12:10
In light of the above, should I delete this answer now? – Donkey_2009 Mar 31 '12 at 20:24
No, the answer is fine. Thanks. Although I made a couple of typos in my post, the point was still the y= and u= – P Sellaz Mar 31 '12 at 21:07

This is not pedantic! The marker is trying to point out where you went wrong.

I will assume that your integral is actually $$\frac{\lambda}{\sqrt{2\pi}}\int_{-\infty}^\infty y^2e^{-(1/2+\lambda x)y^2}\mathrm{d}y\tag{1}$$ First of all, if $u=ay^2$ and $y=-\infty$, it would seem that $u=\infty$, not $0$.

Secondly, if you are going to use $u=ay^2$, you should break up the integral into pieces that will have disjoint domains. Note that under $u=ay^2$ both $(-\infty,0]$ and $[0,\infty)$ get mapped to $[0,\infty)$. To prevent confusion, the integral should first be broken up into $$\small \frac{\lambda}{\sqrt{2\pi}}\int_{-\infty}^\infty y^2e^{-(1/2+\lambda x)y^2}\mathrm{d}y =\frac{\lambda}{\sqrt{2\pi}}\int_{-\infty}^0 y^2e^{-(1/2+\lambda x)y^2}\mathrm{d}y +\frac{\lambda}{\sqrt{2\pi}}\int_0^\infty y^2e^{-(1/2+\lambda x)y^2}\mathrm{d}y\tag{2}$$ One might then notice that since $y^2e^{-(1/2+\lambda x)y^2}$ is even, the two integrals on the right in $(2)$ are equal, therefore $$\frac{\lambda}{\sqrt{2\pi}}\int_{-\infty}^\infty y^2e^{-(1/2+\lambda x)y^2}\mathrm{d}y =\frac{2\lambda}{\sqrt{2\pi}}\int_0^\infty y^2e^{-(1/2+\lambda x)y^2}\mathrm{d}y\tag{3}$$ Finally, we can apply $u=ay^2$: \begin{align} \frac{2\lambda}{\sqrt{2\pi}}\int_0^\infty y^2e^{-(1/2+\lambda x)y^2}\mathrm{d}y &=\frac{2\lambda}{\sqrt{2\pi}}\int_0^\infty\frac{u}{a}e^{-u}\frac{\mathrm{d}u}{2ay}\\ &=\frac{\lambda}{\sqrt{2\pi}}\int_0^\infty\frac{u}{a}e^{-u}\frac{\mathrm{d}u}{\sqrt{au}}\tag{4} \end{align} Note the correct translation of $\mathrm{d}y$. Therefore, the substitution should yield $$\frac{\lambda}{\sqrt{2\pi}}\int_{-\infty}^\infty y^2e^{-(1/2+\lambda x)y^2}\mathrm{d}y =\frac{\lambda}{\sqrt{2\pi}}\int_0^\infty\frac{u}{a}e^{-u}\frac{\mathrm{d}u}{\sqrt{au}}\tag{5}$$

-
This is the correct $f_X(x)=c/(\lambda x+\frac12)^{3/2}$. Note that $f_X$ is integrable at $+\infty$, as it should as the density of a random variable (while the OP's suggestion $f_X(x)=c/(\lambda x+\frac12)$ is not). – Did Mar 31 '12 at 12:36
The lower limit went to 0 in my script because of symmetry (note the factor of 2 outside the 2nd integral). I did forget the $1/\sqrt{au}$ in my post (it was correct in my script. I just forgot it in the posting above). So, I got correct answer. I just lost a mark regarding the y= and the u= . – P Sellaz Mar 31 '12 at 17:08
[sigh] Sorry, yes, the original integral in my OP is wrong as it should be $\frac{\lambda}{\sqrt{2\pi}}\int_{-\infty}^\infty y^2 \text{exp}(-(1/2+\lambda x)y^2)\mathrm{d}y\tag{1}$ – P Sellaz Mar 31 '12 at 17:25

FWIW, this is my complete answer to the question:

$$f_X(x)=\frac{\lambda}{\sqrt{2\pi}}\int_{-\infty}^\infty y^2 \text{exp}(-(1/2+\lambda x)y^2)\mathrm{d}y$$

Let $a=\frac{1}{2}+\lambda x$ for brevity and $u=ay^2$ so $du=2ay \mathrm{ d}y$. Then

$$f_X(x)=\frac{2\lambda}{\sqrt{2\pi}}\int_{0}^{\infty}\frac{u}{a} e^{-u} \frac{\mathrm{d}u}{2\sqrt{au}}$$

using the symmetry of the integrand. So

\begin{align} f_X(x) &= \frac{\lambda a^{-\frac{3}{2}}}{\sqrt{2\pi}}\int_{0}^{\infty}u^{\frac{3}{2}-1}e^u \mathrm{d}u\\ &= \frac{\lambda a^{-\frac{3}{2}}\Gamma(3/2)}{\sqrt{2\pi}}\\ &= \frac{\lambda}{2 \sqrt{2}(\frac{1}{2}+\lambda x)^{\frac{3}{2}}} \end{align}

I got 6 out of 7 marks - with 1 mark deducted for not writing y= and u= in the integration limits, and this is what my OP was about - I'm sorry for the typos in the OP !

-
You could always try opening his post for editing and seeing yourself! Otherwise, it's a \$\$ on both sides of an equation to make it appear big and in the centre, and a $\backslash$begin{align} ... $\backslash$end{align} within the two s together with an & before each equals sign and a \\ wherever you want to start a new line if you want the equals signs to line up. I've edited your post now so that the formatting is as in @robjohn's answer - if you have further questions, post them on the meta. – Donkey_2009 Apr 1 '12 at 11:37
@Donkey_2009, thank you ! – P Sellaz Apr 1 '12 at 18:48