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?

  • $\begingroup$ 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. $\endgroup$
    – supinf
    Commented Jul 6, 2018 at 21:28
  • $\begingroup$ @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$. $\endgroup$
    – chausies
    Commented Jul 6, 2018 at 21:58

1 Answer 1


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.

That aside, though, your optimization problem is somewhat degenerate and its solution couldn't be found with this method, because the correct solution would be a distribution that puts all its weight at 0 (i.e. a Dirac delta), and such a solution can almost never be found when using the calculus of variations, which mostly works when everything is smooth.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .