Linear-quadratic problems and the Riccati equation