Optimal Control of ODE exercise 4