PICTURE. A cart sits at position x1 moving right at speed x2. Your hand pushes it with force u. The target is the origin — the little flag at 0. That is the entire universe of this problem.
The arrow labelled u is red because it is the only thing under your command. Everything we do from now on answers one question: how hard, and which way, should that red arrow push, given where the cart is right now?
WHY care that it's linear? Because a straight rule is the only kind we can fully solve in closed form. The whole payoff of LQR rides on this.
PICTURE. The state lives as a point in a plane (position across, velocity up). At every point an arrow shows which way the machine drifts on its own (Ax). Your push Bu nudges that arrow.
Look at the black arrows: with no push, a cart to the right and moving right (x1>0,x2>0) drifts further right — it runs away. The red overlay shows how one choice of u bends those arrows back toward the flag.
WHY squares and not absolute values or fourth powers? Two reasons, one practical, one magical.
Practical: a square is smooth and has no sharp corner at zero, so the machine never chatters.
Magical: a linear machine fed a squared bill produces a controller that is itself linear. That coincidence is the entire reason LQR is beautiful. We prove it below.
PICTURE. A squared penalty is a bowl. Being at the bottom (on-target, no push) costs nothing; climbing the wall costs more and more, faster and faster.
The orange bowl is the error bill in x; the teal bowl is the effort bill in u. Because Q⪰0 and R≻0, both bowls open upward — they never dip below the ground. LQR looks for the path that keeps total bowl-height smallest, forever.
WHY must V be a bowl (a quadratic x⊤Px)? Three clues, each forced:
At the target, playing perfectly costs zero, so V(0)=0 — the bowl touches ground at the origin.
Left and right of target are symmetric mirror situations, so no odd/linear term survives.
A straight machine can't manufacture cubes or quartics out of a squared bill — the shape stays a clean bowl.
So V(x)=x⊤Px, where P is an unknown symmetric grid of numbers — the one thing we must find. This choice is exactly the value-function guess.
PICTURE. The bowl V sits over the state plane. Its steepness in each direction is set by P. Find P and you know the price of every situation — and, as we'll see, the perfect push.
That last line is the HJB equation. The slogan "instant cost cancels the fall of the future bill" is now derived, not merely asserted.
PICTURE. Stand on the inside wall of the bowl. The uphill slope arrow is ∇V. Your motion x˙=Ax+Bu is another arrow. Their alignment (via the chain rule) tells you whether the future bill is dropping (moving downhill) and how fast.
Inside the bracket, the only thing you control is u. Everything with a u in it:
a bowl in uu⊤Ru+a tilt2x⊤PBu
This is a bowl (because R≻0, i.e. R is a genuine upward bowl) tilted by the state. A tilted bowl has exactly one lowest point. Slide to it by setting the slope in u to zero:
2Ru+2B⊤Px=0⟹u∗=−R−1B⊤Px=−Kx
WHY does R−1 appear, and why must R be strictly positive? If effort were free (R→0) you'd shove infinitely hard — the bowl in u would be flat and have no bottom. A real, strictly-positive R gives the bowl a genuine bottom, so R−1 exists and one finite best push exists. This is the feedback law u=−Kx, now derived rather than guessed.
PICTURE. For a fixed state, the cost as a function of your push is a parabola. Its vertex is the perfect push. Steeper parabola (bigger R) → vertex closer to zero → gentler push.
We now substitute u∗=−R−1B⊤Px into Bellman's balance and carefully collect terms. Start from
0=x⊤Qx+u∗⊤Ru∗+2x⊤P(Ax+Bu∗).
Term (i) — the drift 2x⊤PAx becomes the symmetric pair A⊤P+PA. The number x⊤PAx is a 1×1 scalar, so it equals its own transpose: x⊤PAx=(x⊤PAx)⊤=x⊤A⊤P⊤x=x⊤A⊤Px (using P=P⊤). Averaging the two identical copies,
2x⊤PAx=x⊤PAx+x⊤A⊤Px=x⊤(A⊤P+PA)x.
So the lone lop-sided PA is rewritten as the symmetric sum A⊤P+PA — the "drift up the bowl" term.
Term (ii) — the two u∗ pieces merge into −PBR−1B⊤P. Plug u∗=−R−1B⊤Px into the effort cost and the tilt separately:
u∗⊤Ru∗=x⊤PB=R−1R−1RR−1B⊤Px=+x⊤PBR−1B⊤Px,2x⊤PBu∗=−2x⊤PBR−1B⊤Px.
Add them: (+1−2)=−1, so together they give
−x⊤PBR−1B⊤Px.
This is exactly what steering saves — the optimizer buys a reduction, hence the minus sign.
Collect (i) + (ii) + the error term x⊤Qx:0=x⊤(drift up the bowlA⊤P+PAwhat steering saves−PBR−1B⊤P+running error priceQ)x.
This must hold at every state x. A quadratic form that is zero for all x can only come from the flat zero matrix, so the whole grid in the middle must vanish:
WHY nonlinear? The saving term has P multiplied by P — a square. That single squared term is what makes this a Riccati equation rather than a plain linear one.
PICTURE. The equation is a see-saw of grids: drift (A⊤P+PA) and error price (Q) push P up; the steering saving (−PBR−1B⊤P) pulls it down. The balance point is the P we want.
PICTURE. Three miniature bowls side by side: cheap fuel (deep narrow bowl, sharp gain), free error (flat wide bowl, lazy gain), and the correct-vs-wrong root (bowl up vs bowl down).
Each black arrow between panels is a "therefore": linear + quadratic therefore bowl therefore linear law therefore Riccati therefore one gain.
Recall Feynman: the whole walk in plain words
You're pushing a cart to a flag. First I taught you the two numbers that describe the cart (where, how fast) and the one thing you control (your push). The cart obeys a straight-line rule: your push feeds its speed, its speed feeds its position. Then I handed you a bill — one part for sitting far from the flag, one part for shoving hard — and I squared both so the bill is a smooth bowl that never dips below zero (that's Q⪰0, R≻0). Standing anywhere, there's a price of your situation, and because everything is straight-and-squared that price is itself a smooth bowl, x⊤Px. Perfect play means the bill you pay each second exactly matches how fast your future bill drops as you slide down that bowl — I got that by splitting time into "the next instant" plus "everything after," which is Bellman's principle, and using the chain rule dV/dt=∇V⊤x˙ because the bowl is smooth. Freeze the state and your push-vs-cost is a simple U-curve; its bottom is the perfect push, and it turns out to be just "push in proportion to how far off you are," u=−Kx. Feed that best push back into the balance and the algebra coughs up one matrix equation — Riccati — whose good (bowl-up) solution P gives you K once and for all. Cheap fuel → hammer it; ruinously dear fuel → barely tap; free error → laze; runaway cart → still tamed. One recipe, computed once, works everywhere.