# Finding a constant to make a valid pdf

Let $f(x) = c\cdot 2^{-x^2}$. How do I find a constant $c$ such that the integral evaluates to $1$?

-
Since you already have two answers showing that $f(x) = c\, e^{-x^2\ln(2)}$, I will suggest that rather than the error function, you simply use what I hope you already know: $$\frac{1}{\sigma \sqrt{2\pi}}e^{-x^2/(2\sigma^2)}~~\text{is the density function of a}~N(0,\sigma^2)~ \text{random variable}.$$ Now compare constants and deduce the value of $c$. As a side benefit, you also get the mean and variance of the random variable for free. – Dilip Sarwate Apr 30 '12 at 1:55

You can write $2^{-x^2}$ as $$2^{-x^2}=e^{(\ln 2)({-x^2})}=e^{-x^2\ln 2}$$Using the error function you can calculate the integral $$\int_{-\infty}^{+\infty}e^{-x^2\ln 2}=\sqrt{\frac{\pi}{\ln 2}}$$ The rest is trivial.
Hint: Rewrite $$f(x) = c \,[e^{\ln(2)}]^{-x^2} = c\, e^{-x^2\ln(2)}$$ and try to exploit the following integral together with some change of variable: $$\int^{\infty}_0 e^{-x^2} \,dx = \frac{\sqrt{\pi}}{2}$$