Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to find $\max_{f}\int_{0}^{\infty}f\left(x\right)dx$ subject to $\int_{0}^{\infty}xf\left(x\right)dx=x_{0}$, where $f$ is a function and $x_{0}$ is a constant?

share|cite|improve this question
What do you assume on these $f$? Integrability? – Davide Giraudo Feb 29 '12 at 11:27
I am sorry that I forgot to add any restrictions. Yes, $f$ should be integrable. In fact, it should be a probability density function. – amu Feb 29 '12 at 12:13
@amu: If $f$ is a probability density function, then by definition $\int_0^{\infty} f(x) dx \leq 1$, where equality should be easily achievable by some appropriate choice of $f$. – TMM Feb 29 '12 at 12:47
up vote 5 down vote accepted

Case 1: No restrictions on $f$

Taking $f(x)$ as a huge Dirac delta function centered at some small $\epsilon > 0$ as $$f(x) = \frac{x_0}{\epsilon}\delta(x - \epsilon)$$ gives you $$\int_{0}^{\infty} x f(x) dx = x_0$$ as required, and $$\int_{0}^{\infty} f(x) dx = \frac{x_0}{\epsilon}.$$ Letting $\epsilon \to 0$ thus gives you that the maximum is unbounded (unless you are given more restrictions on $f$).

Case 2: $f$ is a probability density function

Then, by definition, $$\int_{0}^{\infty} f(x) dx \leq 1,$$ and taking $f(x) = \delta(x - x_0)$ achieves this bound. Note that this $f$ corresponds to a discrete random variable $X$ with $P(X = x_0) = 1$.

For extra insight, note that the question can be nicely formulated in terms of probabilities:

Find $\max_F (1 - F(0))$ subject to $E(X) = x_0$.

Then the solution $X \equiv x_0$ described above becomes even more obvious.

share|cite|improve this answer
But the integral is from $0$ to $\infty$ rather than from $-\infty$ to $\infty$. – amu Feb 29 '12 at 12:17
@amu: The (shifted) Dirac delta function has no mass at any point apart from $0$ (shifted: $\epsilon$), so also integrating from $-\infty$ to $0$ adds $0$ to both integrals. – TMM Feb 29 '12 at 12:45
That's right! Thank you so much! – amu Mar 1 '12 at 12:08
@TMM, Really nice trick with the Dirac Delta. Any chance for assistance here:… – Drazick Dec 14 '14 at 7:19

Since $f$ is a probability density function, $$\max_f \int_0^\infty f(x)\mathrm dx \leq \max_f \int_{-\infty}^\infty f(x)\mathrm dx = 1.$$ Since $x_0$ is necessarily a positive number, then for any positive random variable $$\int_0^\infty f(x)\mathrm dx = \int_{-\infty}^\infty f(x)\mathrm dx = 1$$ (since $f(x) = 0$ for $x < 0$) and so $\max_f \int_0^\infty f(x)\mathrm dx = 1$.

Or, did you mean to ask

What is $\max_f \max_{x\in (0,\infty)} f(x)$ over all probability density functions $f(x)$ such that $\int_0^\infty xf(x)\mathrm dx = x_0$ where $x_0$ is a finite positive constant?

in which case TMM's answer shows that $f$ can have arbitrarily large value.

share|cite|improve this answer
I see. Thank you so much! – amu Mar 1 '12 at 12:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.