This page is a drill through every kind of situation an inner-product question can throw at you. We start by listing all the case classes in one table, then work an example for each cell so you never meet a scenario cold. Everything here rests on the parent note : an inner product ⟨ ⋅ , ⋅ ⟩ is a rule that eats two vectors and returns one number, obeying symmetry , linearity in the first slot , and positive-definiteness (⟨ v , v ⟩ ≥ 0 , and = 0 only for the zero vector).
Reminder of the derived geometry we will keep using:
∥ v ∥ = ⟨ v , v ⟩ , cos θ = ∥ u ∥ ∥ v ∥ ⟨ u , v ⟩ , u ⊥ v ⟺ ⟨ u , v ⟩ = 0.
Here is every case class this topic can put in front of you. Each later example is tagged with the cell it lands in.
#
Case class
What makes it tricky
Example
A
Standard positive angle (⟨ u , v ⟩ > 0 )
cosine in ( 0 , 1 ) , acute angle
Ex 1
B
Negative inner product (⟨ u , v ⟩ < 0 )
obtuse angle, sign of cosine
Ex 2
C
Orthogonal case (⟨ u , v ⟩ = 0 )
right angle in that geometry
Ex 3
D
Degenerate / zero input (v = 0 )
cosine formula divides by zero
Ex 4
E
Non-standard weights stretch axes
usual right angle stops being right
Ex 5
F
Function space (integral)
orthogonality by integrating a period
Ex 6
G
Limiting / boundary of Cauchy–Schwarz (equality)
cos θ = ± 1 , parallel vectors
Ex 7
H
Real-world word problem
translate words into an inner product
Ex 8
I
Exam twist: "is this an inner product?"
one axiom quietly fails
Ex 9
We now hit every cell.
Worked example Ex 1 (Cell A): angle between
( 3 , 1 ) and ( 1 , 2 ) under the standard dot product
Use ⟨ u , v ⟩ = u 1 v 1 + u 2 v 2 . Find the angle θ .
Forecast: the arrows both point up-and-right, so guess: acute, cosine positive, somewhere near 4 5 ∘ ?
Inner product. ⟨ u , v ⟩ = ( 3 ) ( 1 ) + ( 1 ) ( 2 ) = 5 .
Why this step? This one number carries all the geometry; positive already tells us the angle is acute (Cell A).
Norms. ∥ u ∥ = 3 2 + 1 2 = 10 , ∥ v ∥ = 1 2 + 2 2 = 5 .
Why this step? cos θ needs the lengths to normalise away "how long" so only "which direction" remains.
Cosine. cos θ = 10 5 5 = 50 5 = 5 2 5 = 2 1 .
Why this step? Divide the inner product by the product of lengths — the definition of angle.
Angle. θ = arccos 2 1 = 4 5 ∘ .
Why this step? arccos answers "which angle has this cosine?" — it undoes the cosine.
Verify: 2 1 ≈ 0.707 ∈ ( − 1 , 1 ) ✓ (Cauchy–Schwarz respected), and 0 < 0.707 < 1 ✓ so acute, matching the forecast. See Cauchy-Schwarz Inequality .
Worked example Ex 2 (Cell B): angle between
( 2 , 1 ) and ( − 1 , 1 )
Standard dot product again.
Forecast: one arrow leans right, the other leans left — they open past a right angle. Guess: obtuse, negative cosine.
Inner product. ⟨ u , v ⟩ = ( 2 ) ( − 1 ) + ( 1 ) ( 1 ) = − 1 .
Why this step? A negative value means the vectors point "more away than toward" each other — that is what obtuse means.
Norms. ∥ u ∥ = 5 , ∥ v ∥ = 2 .
Cosine. cos θ = 5 2 − 1 = 10 − 1 ≈ − 0.316 .
Why this step? The minus sign survives the division, so the cosine is negative — the fingerprint of Cell B.
Angle. θ = arccos ( − 0.316 ) ≈ 108. 4 ∘ .
Verify: ∣ − 0.316∣ < 1 ✓; cosine negative ⇒ angle in ( 9 0 ∘ , 18 0 ∘ ) ✓, matching the forecast.
Worked example Ex 3 (Cell C): are
p ( x ) = x and q ( x ) = 1 − x orthogonal?
Use the evaluation inner product on degree-≤ 1 polynomials: ⟨ p , q ⟩ = p ( 0 ) q ( 0 ) + p ( 1 ) q ( 1 ) .
Forecast: these are just lines on paper — surely not perpendicular? But orthogonality is relative to the inner product . Guess before computing.
Evaluate at the sample points. p ( 0 ) = 0 , p ( 1 ) = 1 , q ( 0 ) = 1 , q ( 1 ) = 0 .
Why this step? This inner product only "sees" the values at x = 0 and x = 1 ; those two numbers per function are its whole world.
Combine. ⟨ p , q ⟩ = ( 0 ) ( 1 ) + ( 1 ) ( 0 ) = 0 .
Why this step? Zero inner product is the definition of orthogonal — no picture-angle needed.
Verify: the value is exactly 0 ✓. So x ⊥ ( 1 − x ) in this geometry even though they aren't 9 0 ∘ on graph paper. See Orthogonality and Gram-Schmidt .
Worked example Ex 4 (Cell D): what is the angle between
v = ( 2 , 3 ) and the zero vector 0 ?
Standard dot product.
Forecast: the zero vector has no direction — does the angle even exist? Guess: undefined.
Inner product. ⟨ v , 0 ⟩ = ( 2 ) ( 0 ) + ( 3 ) ( 0 ) = 0 .
Why this step? Every inner product gives 0 against the zero vector (linearity: ⟨ v , 0 ⋅ 0 ⟩ = 0 ).
Norm of 0 . ∥ 0 ∥ = ⟨ 0 , 0 ⟩ = 0 = 0 .
Why this step? Positive-definiteness says only the zero vector has zero length — here it does.
Try the cosine. cos θ = ∥ v ∥ ⋅ 0 0 = 0 0 .
Why this step? The denominator is 0 , so the formula divides by zero — undefined.
Verify: the angle is genuinely undefined , not 9 0 ∘ . People wrongly call ⟨ v , 0 ⟩ = 0 "orthogonal", but the zero vector is orthogonal to everything and has no direction, so no angle exists. This is the degenerate boundary case.
⟨ v , 0 ⟩ = 0 so the angle is 9 0 ∘ ."
Why it feels right: zero inner product usually means right angle.
The fix: cos θ = 0/0 here — the angle is undefined , because 0 has no direction to make an angle with.
Worked example Ex 5 (Cell E): are
( 1 , 0 ) and ( 0 , 1 ) orthogonal under ⟨ u , v ⟩ = 3 u 1 v 1 + 2 u 2 v 2 ? And what is ∥ ( 1 , 1 ) ∥ ?
Forecast: in the usual geometry the axes are perpendicular. Does re-weighting them break that? Guess.
Inner product of the axis vectors. ⟨( 1 , 0 ) , ( 0 , 1 )⟩ = 3 ( 1 ) ( 0 ) + 2 ( 0 ) ( 1 ) = 0 .
Why this step? Even with weights, the cross terms vanish because each vector lives on one axis — so the axes stay orthogonal here.
A vector that is NOT on an axis. Take ( 1 , 1 ) : ⟨( 1 , 1 ) , ( 1 , 1 )⟩ = 3 ( 1 ) + 2 ( 1 ) = 5 , so ∥ ( 1 , 1 ) ∥ = 5 .
Why this step? The weights stretch the plane unevenly, so this length differs from the ordinary 2 .
Show a bent angle. Under this inner product ( 1 , 1 ) and ( 1 , − 1 ) : ⟨( 1 , 1 ) , ( 1 , − 1 )⟩ = 3 ( 1 ) ( 1 ) + 2 ( 1 ) ( − 1 ) = 3 − 2 = 1 = 0 .
Why this step? On plain paper ( 1 , 1 ) ⊥ ( 1 , − 1 ) at 9 0 ∘ ; here the value is 1 = 0 , so they are not orthogonal — the weights bent the geometry.
Verify: ∥ ( 1 , 1 ) ∥ = 5 ≈ 2.236 = 2 ≈ 1.414 ✓, confirming distances changed. See Norms and Distance .
Worked example Ex 6 (Cell F): show
f ( x ) = 1 and g ( x ) = cos ( 2 π x ) are orthogonal on [ 0 , 1 ]
Use the integral inner product ⟨ f , g ⟩ = ∫ 0 1 f ( x ) g ( x ) d x .
Forecast: a flat line and a full cosine wave — the wave spends equal time above and below zero, so guess: their product integrates to 0 .
Set up. ⟨ f , g ⟩ = ∫ 0 1 1 ⋅ cos ( 2 π x ) d x .
Why this step? Multiply the two functions pointwise, then sum (integrate) — that is the inner product for functions.
Integrate. ∫ 0 1 cos ( 2 π x ) d x = [ 2 π sin ( 2 π x ) ] 0 1 = 2 π sin 2 π − sin 0 = 2 π 0 − 0 = 0 .
Why this step? We integrate over exactly one full period, so the positive and negative humps cancel.
Verify: the integral is exactly 0 ✓ — so the constant function is orthogonal to cos ( 2 π x ) . This equal-area cancellation is the engine behind Fourier Series .
Worked example Ex 7 (Cell G): angle between
( 2 , 4 ) and ( 1 , 2 ) (parallel vectors)
Standard dot product.
Forecast: ( 2 , 4 ) is exactly 2 × ( 1 , 2 ) — same direction. Guess: cosine hits its extreme value + 1 , angle 0 ∘ , and Cauchy–Schwarz becomes an equality .
Inner product. ⟨ u , v ⟩ = ( 2 ) ( 1 ) + ( 4 ) ( 2 ) = 10 .
Norms. ∥ u ∥ = 4 + 16 = 20 , ∥ v ∥ = 1 + 4 = 5 .
Cosine. cos θ = 20 5 10 = 100 10 = 10 10 = 1 .
Why this step? When one vector is a positive scalar multiple of the other, the discriminant trick in Cauchy–Schwarz gives equality — the parabola just touches zero.
Angle. θ = arccos ( 1 ) = 0 ∘ .
Verify: ∣ ⟨ u , v ⟩ ∣ = 10 and ∥ u ∥∥ v ∥ = 10 , so ∣ ⟨ u , v ⟩ ∣ = ∥ u ∥∥ v ∥ — the equality case of Cauchy–Schwarz ✓, exactly as forecast. (Anti-parallel vectors like ( 2 , 4 ) and ( − 1 , − 2 ) would give cos θ = − 1 , the other boundary.)
Worked example Ex 8 (Cell H): "similarity" of two products by feature scores
A phone A scores ( camera , battery , price ) = ( 8 , 6 , 4 ) and phone B scores ( 2 , 9 , 7 ) . Using cosine similarity (the inner-product angle), how alike are they?
Forecast: they disagree on camera but overlap on battery/price — guess a middling positive cosine, an acute angle far from 0 ∘ .
Inner product. ⟨ A , B ⟩ = 8 ( 2 ) + 6 ( 9 ) + 4 ( 7 ) = 16 + 54 + 28 = 98 .
Why this step? The dot product adds up how much the two "agree" feature by feature — larger = more similar.
Norms. ∥ A ∥ = 64 + 36 + 16 = 116 , ∥ B ∥ = 4 + 81 + 49 = 134 .
Why this step? Normalising removes "one phone just has bigger numbers", leaving only the pattern of scores.
Cosine similarity. cos θ = 116 134 98 = 15544 98 ≈ 124.68 98 ≈ 0.786 .
Angle. θ = arccos ( 0.786 ) ≈ 38. 2 ∘ .
Verify: 0.786 ∈ ( − 1 , 1 ) ✓; acute and fairly similar, matching the forecast. This is literally how recommender systems compare items — geometry from an inner product. See Dot Product .
Worked example Ex 9 (Cell I): decide whether
⟨ u , v ⟩ = u 1 v 1 − u 2 v 2 on R 2 is an inner product
Forecast: it looks symmetric and linear — tempting to say yes. But check every axiom before committing.
Symmetry. u 1 v 1 − u 2 v 2 = v 1 u 1 − v 2 u 2 ✓.
Why this step? Multiplication commutes, so swapping u , v changes nothing.
Linearity in slot 1. ⟨ c u + w , v ⟩ = c ( u 1 v 1 − u 2 v 2 ) + ( w 1 v 1 − w 2 v 2 ) ✓.
Why this step? Each term is linear in the first vector's components.
Positive-definiteness — the trap. Test v = ( 0 , 1 ) : ⟨( 0 , 1 ) , ( 0 , 1 )⟩ = 0 − 1 = − 1 < 0 .
Why this step? Axiom 3 demands ⟨ v , v ⟩ ≥ 0 ; here it is negative , so length would be imaginary.
Verify: ⟨( 0 , 1 ) , ( 0 , 1 )⟩ = − 1 < 0 ✓ (the failure is real). Not an inner product — positive-definiteness fails. This is the single axiom that exam twists most often break.
Recall Quick self-test across all cells
Sign of cos θ when ⟨ u , v ⟩ < 0 ::: negative → obtuse angle (Cell B).
Angle between a vector and 0 ::: undefined — division by zero (Cell D).
Do axes stay orthogonal under ⟨ u , v ⟩ = 3 u 1 v 1 + 2 u 2 v 2 ::: yes, but off-axis right angles get bent (Cell E).
What makes Cauchy–Schwarz an equality ::: the two vectors are scalar multiples (parallel/anti-parallel) (Cell G).
Which axiom kills u 1 v 1 − u 2 v 2 ::: positive-definiteness (Cell I).
Mnemonic Reading the inner-product number
Sign tells the angle, size tells the closeness: positive → acute, zero → orthogonal, negative → obtuse; and ∣ ⟨ u , v ⟩ ∣ can never beat ∥ u ∥∥ v ∥ .