Let's consider the following deterministic optimal control problem, where $c(t)$ is the control, and $x(t)$ and $y(t)$ are the state variables: \begin{align} J(t) = \inf_{c(t)} \ &\int_0^\infty e^{-\delta u} \left( x^2(u) + \lambda y^2(u) \right) du \end{align} where the dynamics for the states are: \begin{align} x'(t) &= c(t) - y(t) - a \\ y'(t) &= \delta y(t) - b x(t) \end{align} where $\lambda > 0$, $a>0$ and $b>0$ are constants, $x(0)=x_0$, and the transversality $\lim_{T \to \infty} E_t [e^{-\delta T} y(T)]=0$ condition holds. Notice that the control impacts the dynamics of $x$ directly, and those of $y$ indirectly by affecting $x$.
Solution
First, I write the Hamiltonian: \begin{align} \mathcal{H} = x^2(t) + \lambda y^2(t) + J_{x}(t) ( c(t) - y(t) - a ) + J_{y}(t) \left( \delta y(t) - b x(t) \right) \end{align} where $J_{x}(t)$ and $J_{y}(t)$ denote the derivatives of the value function with respect to the states (i.e. the co-state variables).
Next, I write the optimality conditions: \begin{align} 0 = \mathcal{H}_{c}(t) &\rightarrow 0 = J_{x}(t) \nonumber \\ 0 = \mathcal{H}_{x}(t) + J_{x}'(t) - \delta J_{x}(t) &\rightarrow 0 = 2 x(t) - J_{y}(t) b \nonumber \\ 0 = \mathcal{H}_{y}(t) + J_{y}'(t) - \delta J_{y}(t) &\rightarrow 0 = 2 \lambda y(t) + J_{y}'(t) \nonumber \end{align} Differentiating the second condition: \begin{align} 0 = 2 x'(t) - J_{y}'(t) b \rightarrow J_{y}'(t) = \frac{2 x'(t)}{b} \end{align} and substituting it in the third: \begin{align} 0 = 2 \lambda y(t) + \frac{2 x'(t)}{b} \rightarrow x'(t) = - \lambda b y(t) \end{align} Finally, substituting this result in the law of motion for $x$, I obtain the optimal control: \begin{align} c(t) = x'(t) + y(t) + a \rightarrow c(t) = (1 - \lambda b ) y(t) + a \end{align}
Question
Looking at the problem, I would be tempted to say that since the Hamiltonian is linear in the control, this is a bang bang problem and $c(t) = +\infty$ when $J_x(t) > 0$ and $c(t) = -\infty$ when $J_x(t) < 0$. How are these two results consistent?