# Integrate $\int_{-\infty}^{\infty}\frac{1}{2\pi}e^{(-\frac{1}{2}(\frac{x^2}{4}+4y^2))} dy$

I'm trying to integrate $$\int_{-\infty}^{\infty}\frac{1}{2\pi}e^{(-\frac{1}{2}(\frac{x^2}{4}+4y^2))} dy$$ using the fact that the integral of any normal PDF is 1. But I'm having trouble completing the square for $$(\frac{x^2}{4} + 4y^2)$$. Can anyone help me please? Thanks!

• Is this a question from a course or textbook? If so, please add the [self-study] tag & read its wiki. – S. Kolassa - Reinstate Monica May 5 at 5:13
• Hint: You don't need to complete a square. You only integrate over $y$, not $x$, so you treat $x$ as a constant. – S. Kolassa - Reinstate Monica May 5 at 5:13
• The solution of this question is already posted, but the details of solving the integral are omitted. – qhy May 5 at 5:22
• I think in the course we always use the completing square trick, and we can use that trick exactly because x is a constant. Otherwise integrating the pdf with respect to y does not yield 1. – qhy May 5 at 5:24
• This is just a normal pdf multiplied by a constant. Pull out the parts that don't depend on $y$ and you should be able to solve it pretty quickly. – Reinstate Monica May 5 at 5:24

You don't need to complete a square. You only integrate over $$y$$, not $$x$$, so you treat $$x$$ as a constant.
$$\int_{-\infty}^{\infty}\frac{1}{2\pi}e^{(-\frac{1}{2}(\frac{x^2}{4}+4y^2))} dy = \frac{1}{2\pi}e^{-\frac{x^2}{8}}\int_{-\infty}^{\infty}e^{-2y^2} dy.$$
Multiply and divide by the same factor that turns the integral into an integral over the PDF of a normal distribution with mean $$0$$ and variance $$\frac{1}{4}$$, since this integral is one:
$$= \frac{1}{2\pi}e^{-\frac{x^2}{8}}\sqrt{2\pi\times\frac{1}{4}}\underbrace{\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi\times\frac{1}{4}}}e^{-\frac{y^2}{2\times\frac{1}{4}}} dy}_{=1} = \frac{1}{2\pi}e^{-\frac{x^2}{8}}\sqrt{2\pi\times\frac{1}{4}} = \frac{1}{2\sqrt{2\pi}}e^{-\frac{x^2}{8}}.$$