# 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$?

-

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

## 2 Answers

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}$$

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 6, "mathjax_display_tex": 5, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9053893089294434, "perplexity_flag": "head"}