# Find density function $f(x)$ given a known equation

If you know that $\int_{-\infty }^{\infty } f(x) \, dx = 1$.

And that: $f''(x)+x f'(x)+f(x)=0$

Can you find what $f(x)$ is?

Edit: I'm sorry I corrected my question.

-
What have you tried? Can you determine what $f(x)$ must be if it integrates to $1$? –  gt6989b Mar 8 '13 at 19:50
are these indefinite or definite integrals? –  Christopher A. Wong Mar 8 '13 at 19:53
Say $f$ is positive. Then you can view $f$ as a probability density function from the constraint $\int f = 1$, and $\int x f(x) dx$ is the expectation of the corresponding random variable with law given by the density $f$. Notice now that you have complete liberty to concoct a random variable with arbitrary expectation. –  A Blumenthal Mar 8 '13 at 19:53
If they’r indefinite, what do you mean by $\int f(x)dx=1$? –  Brian M. Scott Mar 8 '13 at 19:57
I find these changing questions to be tiring. –  copper.hat Mar 8 '13 at 20:41

We know from the general theory that the solution set of the given equation forms a 2-dimensional vector space of nice functions. Thus it remains to find a basis. We apply the standard procedure of reducing the order of the equation:

Note that discarding the zeroth-derivative term, the equation reduces to

$$f'' + xf' = 0$$

with integration factor $e^{-x^2/2}$. Thinking of the original equation $f'' + xf' + f = 0$ as a perturbation of this equation, it is a good ansatz to introduce the substitution $f = e^{-x^2/2}u$. Plugging this to the equation, we obtain

$$u'' - xu' = 0.$$

This is easy to solve, yielding $$u = c_1 \mathrm{erfi}\left(\frac{x}{\sqrt{2}} \right) + c_2$$ where $\mathrm{erfi}$ denotes the imaginary error function. Therefore the general solution is

$$f(x) = c_1 e^{-\frac{x^2}{2}}\mathrm{erfi}\left(\frac{x}{\sqrt{2}}\right) + c_2 e^{-\frac{x^2}{2}},$$

which is a linear combination of two linearly independent solutions

$$f_1(x) = e^{-\frac{x^2}{2}}\mathrm{erfi}\left(\frac{x}{\sqrt{2}}\right) \quad \text{and} \quad f_2(x) = e^{-\frac{x^2}{2}}.$$

But it is not hard to show that $f_1$ is not integrable on $\Bbb{R}$. Indeed, L'hospital's rule shows that

$$\lim_{x\to\infty} \frac{\int e^{x^2} \, dx}{e^{x^2}/x} = \lim_{x\to\infty} \frac{e^{x^2}}{e^{x^2} - (e^{x^2}/x^2)} = 1$$

and we have

$$f_1(x) = e^{-x^2/2} \mathrm{erfi}\left(\frac{x}{\sqrt{2}}\right) \sim \sqrt{\frac{2}{\pi}} \frac{1}{x} \quad \text{as} \ x \to \infty.$$

Therefore the condition forces $c_1 = 0$ and $c_2 = \frac{1}{\sqrt{2\pi}}$, uniquely characterizing $f$.

Even though we know the moments

$$\int_{-\infty}^{\infty} x^{k} f(x)\, dx, \qquad (k=0,1,2,\cdots)$$

of every order, we cannot specify the function $f$ uniquely. Indeed there exists a non-trivial function $f$ of Schwarz class (informally, a smooth function with rapid decay) such that

$$\int_{-\infty}^{\infty} x^{k} f(x)\, dx =0 \qquad (k=0,1,2,\cdots)$$

holds.

-
sorry but is this a known function? I don't understand how you arrived at the solution directly. –  Dexter12 Mar 8 '13 at 20:38
how did you reduce the equation to f''+xf'=0 ? –  Dexter12 Mar 11 '13 at 20:41
I guess I made an inappropriate choice of word... That equation has nothing to do with our original equation. What we want to do there is to take advantage of the similarity of those equations. –  Sangchul Lee Mar 11 '13 at 23:31

If you have some function $f:\mathbb{R}\to\mathbb{R}$, such that:

$$\int_{-\infty}^{\infty}f(x)\:dx=1$$

Then $f$ can represent any probability density function over the real numbers. Thus it is impossible to calculate $\int_{-\infty}^{\infty}xf(x)\:dx$ (which represents the expectation value for the random variable with probability density function $f$) without further information as $f$ could be any arbitrary probability distribution, and thus have any real expectation value.

-
This is only true if $f(x) \ge 0$ for all $x$. We could have an $f(x)$ that integrates to one but is negative in some interval. –  Arkamis Mar 8 '13 at 20:11
Thanks for pointing that out, I have actually edited my question, I made a mistake in it and it was incomplete. –  Dexter12 Mar 8 '13 at 20:15