From Giancarlo Ferrari Trecate
LQ control over a finite horizon: proof of the recursive formula for the optimal gains