Topics in convex optimization for optimal control and reinforcement learning