Text this: Necessary and sufficient conditions of optimality for optimal control problem with initial and terminal costs.