I want to find the function $W(x)$ from the following optimization problem: \begin{equation} \textrm{min} \left(I(x) - \int_{-\infty}^{\infty} W(x_0) d(x-x_0) dx_0\right)^2 \end{equation} \begin{equation} \textrm{subject to}\\ -N\leq 0 \\N-1 \leq 0 \end{equation}
Where $N$ is given by:
\begin{equation}
N(W,\Psi) = \int_{-\infty}^{\infty} W(x_0) f(x_0,\Psi) dx_0
\end{equation}
Note that the constraints ($0\leq N\leq 1$) must be true for all $\Psi$. The functions $I(x)$, $d(x)$ and $f(x,\Psi)$ are known. If it helps, I also know that $0\leq I(x) \leq 1$ and $0\leq d(x) \leq 1$ and $0\leq f(x,\Psi) \leq 1$.
$--------------------------------------$
My (unsuccessful) solution so far:
$--------------------------------------$
Write the Lagrangian $L$ in terms of the lagrange multipliers $\mu_1(\Psi)$ and $\mu_2(\Psi)$
\begin{equation}
L(W,x,\mu_1,\mu_2) = \left(I(x) - \int_{-\infty}^{\infty} W(x_0) d(x-x_0) dx_0\right)^2 + \int_{-\infty}^{\infty} -N(W,\Psi) \mu_1(\Psi) d\Psi +
\int_{-\infty}^{\infty} (N(W,\Psi)-1) \mu_2(\Psi) d\Psi
\end{equation}
Solve for $\frac{\partial L}{\partial W}$. Do this by using the formula: $\frac{\partial L}{\partial W} = \frac{d}{d \epsilon}\bigg\vert_{\epsilon=0}L(W(x)+\epsilon \eta(x))$. Where directional derivative is $\eta(x)$.
\begin{equation} \frac{\partial L}{\partial W} = 2\left(I(x) - \int_{-\infty}^{\infty} W(x_0) d(x-x_0) dx_0\right) \left( \int_{-\infty}^{\infty} d(x-x_0) \eta(x_0) dx_0\right) - \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} f(x_0,\Psi) \mu_1(\Psi) \eta(x_0) dx_0 d\Psi + \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} f(x_0,\Psi) \mu_2(\Psi) \eta(x_0) dx_0 d\Psi \end{equation}
Rearrange to get RHS in the form $\int_{-\infty}^{\infty} [\textrm{???} ] \eta(x_0) dx_0$
\begin{equation} \frac{\partial L}{\partial W} = \int_{-\infty}^{\infty} \left[ \left(2I(x) - 2\int_{-\infty}^{\infty} W(x_0) d(x-x_0) dx_0\right)d(x-x_0) + \int_{-\infty}^{\infty} f(x_0,\Psi) \left(\mu_2(\Psi) - \mu_1(\Psi)\right) d\Psi \right] \eta(x_0) dx_0 \end{equation}
Now solve for $\frac{\partial L}{\partial W} = 0$. This means the coefficient of $\eta$ must be $0$.
\begin{equation} \left(2I(x) - 2\int_{-\infty}^{\infty} W(x_0) d(x-x_0) dx_0\right)d(x-x_0) + \int_{-\infty}^{\infty} f(x_0,\Psi) \left(\mu_2(\Psi) - \mu_1(\Psi)\right) d\Psi = 0 \end{equation}
Rearrange
\begin{equation} \int_{-\infty}^{\infty} W(x_0) d(x-x_0) dx_0 = I(x) + \frac{1}{2d(x-x_0)}\int_{-\infty}^{\infty} f(x_0,\Psi) \left(\mu_2(\Psi) - \mu_1(\Psi)\right) d\Psi \end{equation}
Use Fourier transform $F\{\}$ to solve for $W$. Define $F\{W\} = \hat{W}$, and $F\{d\} = \hat{d}$ , and $F\{I\} = \hat{I}$, and $F\{\frac{1}{2d(x-x_0)}\int_{-\infty}^{\infty} f(x_0,\Psi) \left(\mu_2(\Psi) - \mu_1(\Psi)\right) d\Psi\} = \hat{q}$. Therefore
\begin{equation} \hat{W} \hat{d} = \hat{I} + \hat{q} \end{equation}
Rearrange and inverse Fourier transform
\begin{equation} W = F^{-1} \{ \frac{\hat{I}}{\hat{d}} \} + F^{-1} \{ \frac{\hat{q}}{\hat{d}} \} \end{equation}
Define $\bar{W} = F^{-1} \{\frac{\hat{I}}{\hat{d}} \}$ and $Q = F^{-1} \{ \frac{\hat{q}}{\hat{d}} \}$. Side note: notice that $\bar{W}$ is the solution to the unconstrained minimization problem. \begin{equation} W = \bar{W} + Q \end{equation}
Now I can construct the dual problem which states that:
\begin{equation} \textrm{max } h(\mu_1,\mu_2) \end{equation} \begin{equation} \textrm{subject to}\\ \mu_1 \geq 0 \\ \mu_2 \geq 0 \end{equation}
Where $h(\mu_1,\mu_2) = \textrm{min } L(W) = L(\bar{W} + Q)$.
\begin{equation} h(\mu_1,\mu_2) = \left( \frac{1}{2d(x-x_0)}\int_{-\infty}^{\infty} f(x_0,\Psi) \left(\mu_2(\Psi) - \mu_1(\Psi)\right) d\Psi \right)^2 + \int_{-\infty}^{\infty} (\mu_2(\Psi) - \mu_1(\Psi))N(\bar{W} + Q,\Psi) d\Psi - \int_{-\infty}^{\infty} \mu_2(\Psi) d\Psi \end{equation}
Now I need to find the max $h(\mu_1,\mu_2)$. This is where I'm stuck. Shall I solve for $\frac{\partial h}{\partial \mu_1} = 0$ and $\frac{\partial h}{\partial \mu_2} = 0$? How can I find $\mu_1$ and $\mu_2$ from here?