I have a doubt regarding transversality condition in the case of a non linear final pay-off.
For instance, I need to solve with the Pontryagin maximum principle the following optimization problem with the quadratic term $[S(T)]^2$ as the final payoff:
$min~J = [S(T)]^2 + \int\limits_{0}^{T} [u(t)S(t)]^2 dt$
given:
$\frac{\partial S}{\partial t} = - \lambda S(t) [1 - S(t) - R(t)] - S(t)u(t)$,
$\frac{\partial R}{\partial t} = \gamma [1-S(t)-R(t)]$,
$S(t),R(t)\geq 0$, $ S(0) = s_0, R(0) = 0$.
So the question is how can I find the transversality conditions for the adjoint equations $p_S(T)$ and $p_R(T)$.
In my understanding, I have to evaluate how the value of the final payoff $\phi = [S(T)]^2$ varies depending on $S$ and $R$.
Clearly $\frac{\partial \phi}{\partial R} = 0 $ so $p_R(T) = 0$. But when I do $\frac{\partial \phi}{\partial S} = 2S^*(T) $ that depends on the optimal value of $S^*(T)$, which is what I am trying to find. So what I have to do? deriving again? or there are other smarter strategies?
Thanks to anyone that will point me in the right direction.
The condition $$ p_S(T) = 2 S(T) $$ is the correct condition. It introduces a coupling between the adjoint and state equations. In order to solve, you thus have to solve a system of four coupled differential equations.