4.5.2 · D4Linear Algebra (Full)

Exercises — Dot product — formula, cosine formula, Cauchy-Schwarz inequality proof

2,377 words11 min readBack to topic

A reminder of the two faces of the same machine, since every problem leans on one of them:


Level 1 — Recognition

Here means the dot product and means length; both are just the two boxes above.

L1.1

Compute for , .

Recall Solution

WHAT we do: multiply matching slots, add. WHY: the component form is "line the vectors up and sum the products." Nothing geometric needed yet.

L1.2

Find for .

Recall Solution

WHY this tool: length comes from dotting a vector with itself — that is the Pythagorean theorem hiding inside the dot product.

L1.3

Are and perpendicular?

Recall Solution

WHY: two vectors are perpendicular exactly when their dot product is (because ). Dot product is zero → . See Orthogonality and orthonormal bases for the general idea.


Level 2 — Application

L2.1

Find the angle between and .

Recall Solution

WHY the cosine formula: we want an angle, and the only bridge from components to an angle is . Solve it for .

  • WHAT it looks like: in the figure, the yellow arrow lies flat on the -axis and the blue arrow rises steeply; the red wedge between them is the we solved for. Notice the arrow lengths (, ) do not change the angle — only their directions do, which is why the length factors cancelled out of .
Figure — Dot product — formula, cosine formula, Cauchy-Schwarz inequality proof

L2.2

For , , find .

Recall Solution

WHY the cosine formula again: we're asked for , so we run the same bridge — now in 3D, where we cannot easily draw the angle, so the algebra is our only handle on it.

  • Numerator (overlap): Why: multiply matching slots and add — the same machine as L1.1.
  • Denominator (lengths): Why: each length is , the Pythagorean idea in 3D. WHY the sign matters: the numerator carries the sign, and a negative cosine means — the vectors lean away from each other (obtuse angle). (so ). Sanity check: , as any genuine cosine must be — a reassurance that we divided by the lengths correctly.

L2.3

Compute the projection length of onto .

Recall Solution

WHAT a projection is: the shadow casts along the direction of . Its signed length is — see Vector projection. WHY that formula: , and is exactly the adjacent side (the shadow). Dividing by strips out 's length so only the shadow survives. Edge case first — WHY is required: the formula divides by , so it is only defined when . Projecting onto the zero vector is meaningless — the zero vector has no direction to cast a shadow along, and the formula would demand division by . Always confirm before projecting. Here , so we are safe. WHAT to see in the figure: the blue arrow is ; drop a white dashed vertical line straight down onto the direction of (the -axis). Where it lands (red dot at ) marks the tip of the green shadow of length . The shadow is shorter than itself () because part of points up, away from — projection keeps only the part along .

Figure — Dot product — formula, cosine formula, Cauchy-Schwarz inequality proof

Level 3 — Analysis

L3.1

Prove that if for every vector , then .

Recall Solution

WHY subtract: the equation says and have identical overlap with everything. Rewrite using distributivity: The key move: "for all " includes the choice itself. Plug it in: A squared length is zero only for the zero vector, so , i.e. .

L3.2

Show (the parallelogram law).

Recall Solution

WHY expand with the dot product: every length-squared is a dot product, and dot products distribute, so we can just multiply out. WHAT happens on adding: the terms cancel: Picture: the two diagonals of a parallelogram relate to its four sides — this is the algebraic version of that geometry.

L3.3

Given , , , find .

Recall Solution

WHY this identity: expands into things we already know. (This is exactly the Law of cosines in disguise — the side opposite the angle.)


Level 4 — Synthesis

L4.1

Vectors satisfy and . Find .

Recall Solution

WHY expand carefully: the scalars and pull out of the dot product, so track them. Substitute :

L4.2

Find all values of so that and are perpendicular.

Recall Solution

WHY set the dot product to zero: perpendicular . One linear equation → one value of . (If the components had produced a quadratic, we would keep every root.)

L4.3

Using , prove the triangle inequality .

Recall Solution

Start from the square (lengths are non-negative, so squaring is reversible): WHY Cauchy–Schwarz enters: we need an upper bound on the middle term. Cauchy–Schwarz gives . So: Both sides non-negative → take square roots: This is the vector version of "the shortest path is a straight line" — see Triangle inequality.


Level 5 — Mastery

L5.1

Prove the Cauchy–Schwarz inequality without using any angle, and state exactly when equality holds.

Recall Solution

WHY no angle: in an abstract inner product space there is no picture of an angle yet — so we must argue from algebra alone. The single engine is: a squared length is never negative.

Step 1 — build a non-negative machine. For any real number , Step 2 — expand into a quadratic in : Step 3 — force the discriminant . An upward parabola () that never dips below the axis can touch it at most once, so it has at most one real root: Step 4 — tidy up. Divide by , move the second term over, take square roots (both sides ): Equality case: discriminant means for some , i.e. , so — the vectors are parallel. (Degenerate check: if then , is linear/constant , and both sides are — the inequality holds as .) WHAT to see in the figure: the blue curve is for a non-parallel pair — it floats entirely above the -axis (its minimum is positive), which is exactly "discriminant " and gives the strict inequality. The yellow curve is the parallel case: it just kisses the axis at one point (red dot, ), so the discriminant is and Cauchy–Schwarz becomes an equality. The picture is the proof: "never below the axis" forces the discriminant condition.

Figure — Dot product — formula, cosine formula, Cauchy-Schwarz inequality proof

L5.2

Verify the whole chain numerically for , : compute , both lengths, confirm Cauchy–Schwarz is a strict inequality, and find .

Recall Solution

WHY verify numerically: a general theorem earns trust by surviving concrete tests. We recompute each piece and watch Cauchy–Schwarz hold with room to spare.

  • Overlap: Why: the component machine, as always.
  • Lengths: Why: .
  • The two sides of Cauchy–Schwarz: Why check both? the inequality compares exactly these two numbers; we want to see the left one sitting below the right.
  • Strict or equal? holds, and it is strict because is not a scalar multiple of (no single makes ) — recall equality needs parallel vectors, matching the L5.1 equality case. Sanity: , a valid cosine — the same fact that Cauchy–Schwarz guarantees in general.

L5.3

Suppose three unit vectors satisfy . Find .

Recall Solution

WHY square the sum: the condition involves a sum of vectors; dotting that sum with itself turns it into exactly the pairwise products we want. Expand — the three self-terms are lengths ( each since unit vectors) and each cross pair appears twice: Solve: Sanity: the vectors point apart (like the Mercedes logo), and . ✔


Recap

Recall One-line reflexes to keep

Component dot ::: multiply matching slots, then add → a scalar Length ::: Angle ::: Perpendicular test ::: Projection length onto ::: , valid only when Cauchy–Schwarz ::: , equality iff parallel C–S proof engine ::: → discriminant Squaring a vector sum ::: each cross pair counts twice