# Optimal control of nonlinear harmonic oscillator

Consider the ODE $$\begin{cases} x''(t) + \sin (x(t)) = u(t) \\ x(0)=x_0\\ x'(0)= x_1 \end{cases}$$ and the problem of minimizing $$J(u) = \int_0^T |x(t) - \bar x|^2 dt + \int_0^T u^2(t) dt$$ for $$\bar x \in \mathbb R.$$

Can you point out a reference where the existence (and uniqueness?) of a minimizer and the first-order optimality conditions are analyzed in detail?

I know some resources for the linearized harmonic oscillator $$x''(t) + x(t) = u(t)$$.