# Find a function f(x) that maximizes given integral

Problem. Given a functional

$J(f) = \int_0^{+\infty} e^{-3x} \ln(f(x)) dx \, .$

Find such a function $f(x)$ that maximizes the value of $J(f)$ under the following constraints:

• $f(x) > 0$ for any $x$
• $\int_0^{+\infty}f(x)dx = 1 \, .$

My thoughts. The constraints reminded me of the Exponential probability density function, which meets them perfectly:

$f(x) = \lambda e^{-\lambda x} \, .$

So I plugged it in and that worked great in a sense that I was able to find such a $\lambda$ for the Exponential distribution that delivers the maximum to $J(f)$ if we consider only functions of the above form. It turned out that the maximum is delivered by

$f(x) = 3 e^{-3x} \, .$

My question is: what's next? So I have some solution for $J(f)$, now how can I prove that there is no (or there is) some other function $f'(x)$ that delivers a greater value to $J(f)$?

Euler Lagrange equation from calculus of variation gives $\frac{\partial (J(f) + \alpha (\int fdx -1))}{\partial f}=0$ which trivially gives the solution you have found. The $\alpha$ terms forces the constraint.
• The Wikipedia entry is a start. In general it deals with the case where there are derivatives of $f$ included in $J(x,f,f')$. – user121049 Sep 10 '17 at 10:06
• You are adding zero, which is why you can do it. $\alpha$ is called the Lagrange multiplier and is useful for enforcing equality like constraints. The inequality constraint you have ($f(x)>0$) can't be dealt with in this way. It turns out you are lucky and the solution found obeys the constraint otherwise you would have to reject the solution. – user121049 Sep 12 '17 at 14:50
• Thank you. Also I don't quite understand one thing: according to Wikipedia's article on the Euler-Lagrange equation, if there is a functional $J(f) = \int_a^{b} L(x, f(x)) dx$, the statement of the equation is ${dL \over df} = 0$, which even without $\alpha$ does not coincide with what you have written. Did I get it wrong? – Tu Yu Sep 12 '17 at 19:50