Visual walkthrough — Dot product — formula, cosine formula, Cauchy-Schwarz inequality proof
Before we begin, three words we must agree on, each tied to a picture below.
Step 1 — Draw the objects: two arrows and the angle between them
WHAT. Put two arrows, and , tail-to-tail (starting from the same point). The opening between them is the angle we call (Greek letter "theta", just a name for that angle).
WHY. Everything geometric about two vectors — are they aligned? opposed? at right angles? — lives inside this one angle. If we can pull out of the numbers, we understand the pair completely.
PICTURE. In the figure the two arrows share a tail. The shaded wedge is .

Notice ranges from (arrows on top of each other) to (arrows pointing exactly opposite). We never need angles bigger than that: the smallest opening between two arrows is always in that range.
Step 2 — The two recipes we want to connect
WHAT. There are two ways people write the dot product. We display both and aim to show they are equal.
WHY. One recipe is easy to compute; the other is easy to understand. Connecting them is the whole point of the page.
PICTURE. Left panel: the "multiply-and-add" recipe on the components. Right panel: the "lengths-times-cosine" recipe on the geometry.

- — the horizontal parts multiplied together.
- — the vertical parts multiplied together.
- — the two arrow lengths.
- — a number between and that reports the angle; we explain it next.
The is a promise we have not yet kept. Steps 4–7 keep it.
Step 3 — The one identity that pays for everything:
WHAT. Feed a vector its own self into recipe A:
WHY. By the Pythagorean theorem on the right triangle whose legs are and , that sum is the squared length of . (The closely related Triangle inequality — that any side of a triangle is at most the sum of the other two — is a different result; here we need Pythagoras, the right-angle length rule.) So the dot product already carries "length" inside it — this is the hinge the whole derivation swings on.
PICTURE. The arrow is the hypotenuse of a right triangle with legs (horizontal) and (vertical). The squares on the legs add to the square on the hypotenuse.

Step 4 — Build a triangle so the Law of cosines can enter
WHAT. Draw and tail-to-tail again, then draw the arrow . Geometrically is the arrow that runs from the tip of to the tip of — it closes the triangle.
WHY. We need a bridge between the angle (geometry) and the components (algebra). The Law of Cosines is that bridge: it is the one theorem that relates a triangle's three side lengths to one of its angles. To use it, we first need a triangle — so we build one whose angle is our .
PICTURE. Three sides: , , and the closing side . The angle sits between and , directly opposite the closing side.

Step 5 — Apply the Law of Cosines (geometry side of the bridge)
WHAT. The Law of Cosines for a triangle with sides and included angle , opposite side , says . Plug in , , :
WHY. This equation is the only place the angle appears. If we can compute the left side a different way — without — we can solve for . That different way is recipe A, coming in Step 6.
PICTURE. The same triangle, now with the three squared side-lengths labelled and the cosine correction term highlighted on the side facing .

- When , and the correction vanishes — the formula collapses back to plain Pythagoras. Good sanity check.
Step 6 — Compute the same left side algebraically (component side of the bridge)
WHAT. Expand using the hinge identity from Step 3 (length squared dot with itself) and distributivity:
Term by term: distributing gives four dots — , then , then , then . Because the dot product is commutative, , so the two middle terms are both and add up to . The two end terms become and by the hinge identity.
WHY. We have now written the exact same quantity two ways: once with (Step 5), once with the raw dot product (here). Two expressions for one thing must be equal — that equality is the whole formula.
PICTURE. The expansion shown as a grid of pairings (like FOIL for vectors): the two diagonal boxes give the length-squared terms, the two off-diagonal boxes merge into .

Step 7 — Set them equal and watch two terms cancel
WHAT. Equate Step 5 and Step 6:
The and appear on both sides — subtract them away:
Divide both sides by :
WHY. The promise from Step 2 is now kept: recipe A (, from components) equals recipe B (, the geometry). The dot product silently knows the angle.
PICTURE. The two big expressions stacked with the shared terms greyed out (cancelled) and the surviving terms glowing, arrow pointing to the boxed result.

- — the number recipe A produces.
- — always positive (lengths), so the sign of the dot product is the sign of .
- — the alignment dial.
Step 8 — All the cases: read the sign like a compass
WHAT. Because , the sign of is entirely the sign of . Let us walk every case, including the degenerate ones.
WHY. The contract: the reader must never meet a situation we skipped. Here are all of them.
PICTURE. Five mini-panels: acute, right, obtuse, and the two extremes (same direction, opposite direction).

Recall Quick self-test
If , is the angle acute, right, or obtuse? ::: Obtuse (between and ), because . Two nonzero perpendicular vectors have dot product equal to what? ::: Zero. Why is never negative? ::: Both are lengths, and a length is always .
The one-picture summary
Everything above collapses into a single diagram: the shared-tail triangle carries the geometry (, the Law of Cosines), the component grid carries the algebra (), and the two meet at the boxed identity in the middle.

Recall Feynman retelling — the whole walkthrough in plain words
Picture two arrows starting from the same dot. We wanted one honest number that says "how much do these two point the same way?" We had two ideas for that number. Idea A: line up their sideways parts and their up-down parts, multiply each pair, add — pure arithmetic. Idea B: multiply the two arrow lengths and then dial the answer up or down with the cosine of the angle between them — pure geometry.
To show these are the same number, we needed a bridge between angle and arithmetic. So we drew the triangle you get from the two arrows and the line joining their tips. That third side, tip to tip, is " minus ". Now the Law of Cosines — the one rule linking a triangle's sides to its angle — hands us the length of that third side squared, written with the angle in it. But we can also compute that same squared length by pure arithmetic (a vector's length squared is just itself dotted with itself). Two ways to write one thing means they're equal. When we set them equal, the "length squared of " and "length squared of " show up on both sides and cancel, and what's left, after dividing by minus two, is the famous line: the dot product equals length times length times cosine.
Then we checked every mood of the angle. Leaning the same way → positive. Square corner → exactly zero. Fighting → negative. Perfectly aligned or perfectly opposed → the biggest positive or biggest negative the lengths allow. And if one arrow shrinks to nothing, geometry loses its angle but the arithmetic keeps calm and returns zero. That is why we trust the algebra as the real definition and treat the beautiful cosine picture as its meaning.
Connections
- The projection idea hiding in is developed in Vector projection.
- The zero-dot-product case is the seed of Orthogonality and orthonormal bases.
- The abstract version of "define an angle from a dot product" lives in Inner product spaces.
- The angle machinery here contrasts with the area/normal machinery of the Cross product.
- This walkthrough leans on the Law of cosines and connects to the Triangle inequality.