Convex optimization and implicit differentiation methods for control and estimation