Statement
Let $u(x) \in L^2(-1, 1)$. Solve the following optimization problem:
$$ \begin{cases} J(u) = 4 \int_{-1}^{1} \sqrt{|x| (1 - |x|)} u(x) dx + \left(\int_{-1}^1 \sin(3\pi x) u(x) dx\right)^2 \rightarrow \inf_{u} \\ 3\sqrt{3}\left(\int_{-1}^{1}\sqrt{|x|(1 - |x|)} u(x) dx\right)^2 + \int_{-1}^{1}\sin(3\pi x) u(x )dx \leq 0 \end{cases} $$
Attempted solution
Let's introduce these two functions: $f(x) = \sqrt{|x|(1 - |x|)}$ and $g(x) = \sin(3\pi x)$. Then the problem can be rewritten as: $$ \begin{cases} J(u) = 4 \left<f, u\right> + \left<g, u\right>^2 \\ 3\sqrt{3} \left<f, u\right>^2 + \left<g, u\right> \leq 0 \end{cases} $$
Any function $u \in L^2(-1, 1)$ is in the domain of both $J(u)$ and the inequality. Let's use second-order convexity criterion:
$$ \begin{align} \nabla_u J(u) &= 4f + 2 g\left<g, u\right> \\ \nabla_u^{2}J(u) &= 2g^2(x) \end{align} $$
Since $\forall h \in L^2(-1, 1)$ we have $\left<2g^2h, h\right> = 2\int_{-1} ^ {1}g^2(x)h^2(x) dx \geq 0$ then we conclude that $J(u)$ is convex. We use the same approach to show the inequality is convex, which results in the problem being convex.
Now I am going to say that function
$$ u(x) = \begin{cases} 1, x \in [0, 1] \\ -1, x \in [-1, 0) \end{cases} $$
is the one to satisfy Slaiter's condition. This means that the KKT conditions are not only necessary but sufficient conditions of extrema for this problem. Let's write KKT conditions:
$$ \begin{cases} 4f + 2g\left<g, u\right> + \lambda_1 \left(6\sqrt{3}f\left<f, u\right> + g\right) = 0, \\ 3\sqrt{3} \left<f, u\right>^2 + \left<g, u\right> \leq 0, \\ \lambda_1 \left(3\sqrt{3} \left<f, u\right>^2 + \left<g, u\right>\right) = 0, \\ \lambda_1 \geq 0 \end{cases} $$
This system is a disaster: I can't solve it. Perhaphs, you can? Have I made a mistake somewhere? Maybe you know the book from which this problem was taken? Are there any good books with solved examples of optimization problems of this level? (Stephen Boyd is really good but I don't believe there are such problems there)
Hint: Your problem is addressed in functional analysis and is a constrained calculus of variations problem. I would form the Lagrangian and get rid of the constraint, and then would try to derive the Lagrange-Euler formula for the problem.