Statement: Find $y(t)$ such that $$ \begin{array}{ll} \text{minimize} & \int_0^\infty dt \left\vert \int_0^t f(t-s) y(s) ds \right\vert^2 \\ \text{subject to} & \int_0^T y(t) dt = C \\ & y(t) = 0, t \geq T\end{array} $$
My solution: Introducing Lagrange multipliers $\lambda_0$ and $\lambda(t)$ for both constraints, this is equivalent to finding the global minima of the functional: $$ \mathcal{L}[\lambda_0, \lambda(t), y(t)] = \int_0^\infty dt \left\vert \int_0^t f(t-s) y(s) ds \right\vert^2 - \lambda_0 \left(\int_0^T y(t) dt - C \right) - \int_T^\infty \lambda(t) y(t) dt $$ The minimization condition $\delta \mathcal{L} / \delta y(t) = 0$ leads after a few lines of derivation to: $$ \int_0^T \xi(|t-s|) y(s) ds = \left\{ \begin{array}{ll} \tfrac{1}{2} \lambda_0 & \text{if } t \in [0, T] \\ \tfrac{1}{2} \lambda(t) & \text{if } t > T\end{array}\right. $$ where $\xi(\delta)$ is a two-point correlation function defined by $\xi(\delta) = \int_0^\infty f(t) f(t+\delta) dt$.
Issue: Here, $y(t)$ can be obtained from inverting the integral transform above for $t \in [0, T]$ and from the first constraint only. In particular, it does not depend on $\lambda(t)$, and I get very weird numerical results compared to what I am expecting. Thus, I think I made a mistake somewhere in the derivation, but it's impossible for me to find where. Would appreciate any help.
Derivation: The functional derivative of the Lagrangian is defined as $$ \int_0^\infty \frac{\delta \mathcal{L}}{\delta y}(t) \phi(t) dt = \left[ \frac{d}{d\epsilon} \mathcal{L}[\lambda_0, \lambda(t), y(t) + \epsilon \phi(t)] \right]_{\epsilon = 0} $$ Evaluating the right-hand side gives \begin{equation} \begin{split} &2 \int_0^\infty dt \int_0^t f(t-u) y(u) du \int_0^t f(t-s) \phi(s) ds - \lambda_0 \int_0^T \phi(t) dt - \int_T^\infty \lambda(t) \phi(t) dt \\ &= 2 \int_0^\infty \,\phi(s) \left( \int_s^\infty f(t-s) \left(\int_0^t f(t - u) y(u) du \right) dt \right)ds - \int_0^\infty \tilde{\lambda}(t) \phi(t) dt \end{split} \end{equation} where we have defined $\tilde{\lambda}(t) = \lambda_0$ for $t \in [0, T]$ and $\lambda(t)$ otherwise. To obtain the second line, we have inverted the first and third integrals of the initial expression. We can thus identify the functional derivative of $\mathcal{L}$ as \begin{equation} \frac{\delta \mathcal{L}}{\delta y}(t) = 2 \int_t^\infty f(s - t) \int_0^s f(s - u) y(u) du ds - \tilde{\lambda}(t) \end{equation} Then, we use the minimization condition $\delta \mathcal{L} / \delta y(t) = 0$ for any $t \in [0, \infty]$. It reads \begin{equation} \tfrac{1}{2} \tilde{\lambda}(t) = \int_t^\infty f(s - t) \int_0^s f(s - u) \varepsilon_Z(u) du ds \end{equation} Manipulating the right-hand side integral, we successively get \begin{align*} \tfrac{1}{2} \tilde{\lambda}(t) &= \int_t^\infty f(s-t) \left( \int_0^t f(s-u) y(u) du + \int_t^s f(s-u) y(u) du\right) ds \\ &= \int_0^t y(u) \left(\int_t^\infty f(s-t) f(s-u) ds \right) du + \int_t^\infty y(u) \left( \int_u^\infty f(s-t) f(s-u) ds \right) du \\ &= \int_0^t y(u) \left(\int_0^\infty f(s) f(s-t+u) ds \right) du + \int_t^\infty y(u) \left( \int_0^\infty f(s) f(s-u+t) ds \right) du \end{align*} Finally, we can regroup the two integrals of the last expression to get the simple form, \begin{equation} \tfrac{1}{2} \tilde{\lambda}(t) = \int_0^T \xi(|t-u|) y(u) du \end{equation} where we have used that $y(t) = 0$ for $t \geq T$, and where we identify the two-point correlation function $\xi$ as \begin{equation} \xi(\delta) = \int_0^\infty f(t) f(t + \delta) dt \end{equation}