# Functional Optimization

This is an extremely (perhaps embarrassingly) basic question.

Suppose I want to choose a distribution $\varphi(x)$ in order to maximize the following expression $K(\mathbb{E}[1-X])$ for some constant $K$. I can set up the following maximization objective.

\begin{equation}J[\varphi] = K\int_{0}^{\infty}(1-x)\varphi(x)dx - \lambda \bigg[ \int_{0}^{\infty}\varphi(x)dx - 1\bigg]\end{equation}

To find local extrema, I take the functional derivative and set equal to $0$; hence

$$\tag{1}\label{1}K(1-x) - \lambda = 0$$

However, since the expectation operator is linear, I should be able to solve the equivalent problem, that of maximizing $-K\mathbb{E}[X]$. I want to maximize

\begin{equation}J[\varphi] = -K\int_{0}^{\infty}x\varphi(x)dx - \lambda \bigg[ \int_{0}^{\infty}\varphi(x)dx - 1\bigg]\end{equation}

As above, I take the functional derivative and set equal to $0$, which yields

$$\tag{2}-Kx - \lambda = 0$$

which is not the same as in (\ref{1}), but it should be! What am I doing wrong?

• is $\lambda$ a constant? What spaces are you using? How exactly did you calculate the derivatives? One has to be more careful with derivatives in infinite dimensional spaces. Jul 6, 2018 at 21:28
• @supinf what he's doing is the standard method for optimizing functionals with constraints via the calculus of variations and Lagrange multipliers. See here for details. That being said, the tool won't work here because the problem is degenerate, similar to how simple calculus will fail to optimize $\max_x x$. Jul 6, 2018 at 21:58

Actually, your two expressions are equivalent, all that will happen is the $\lambda$ will be different between (1) and (2) to account for the slightly changed objective.