We can also find the f minimizing the integral of f^2 by considering the Lagrangian: integral f(x)^2 - lambda f(x) + lambda - mu x f(x) + mu dx, then solving pointwise for f(x) to get f(x) = (lambda + mu x) / 2, then using the constraints to get lambda and mu.