The scalar product attaches a number to a pair of vectors, and that number sees geometry: it vanishes exactly for perpendicular directions, and it measures angles and lengths. It is the engine behind the law of cosines, equations of circles, and perpendicularity computations. The same tool, in space, is the subject of Chapter 31.
16.1 Definition and first computations
Definition 16.1(Scalar product)
The scalar product of two vectorsu and v is the number
u⋅v=21(∥u+v∥2−∥u∥2−∥v∥2),
where ∥u∥ denotes the length (norm) of u.
Theorem 16.2(The four faces of the scalar product)
Let u(x,y) and v(x′,y′) be nonzero vectors, and θ the angle between them. Then
(projection)u⋅v=u⋅v′, where v′ is the orthogonal projection of v on the direction of u; if u=OA and v=OB, then u⋅v=OA×OH, a product of signed lengths, where H is the foot of the perpendicular from B to the line (OA);
2. Choose the coordinate system so that u points along the positive x-axis: u(∥u∥,0) and v(∥v∥cosθ,∥v∥sinθ) (Chapter 14). Formula 1 then gives u⋅v=∥u∥∥v∥cosθ+0. Formula 3 reads off the same computation: the projection of v on the x-axis has signed length ∥v∥cosθ=OH. ∎
The projection view: u⋅v=OA×OH, where H is the foot of the perpendicular from the tip of v. The orange segment OH has signed length ∥v∥cosθ.
Example 16.3
u(3,1) and v(2,−4): u⋅v=6−4=2. The norms are ∥u∥=10 and ∥v∥=20, so cosθ=10202=1022=102: the angle is a bit less than 82∘.
Proof. All follow from the coordinate formula: for instance u⋅(v+w)=x(x′+x′′)+y(y′+y′′)=(xx′+yy′)+(xx′′+yy′′). The last identity expands ∥u+v∥2=(u+v)⋅(u+v) using the first three rules — the scalar product behaves exactly like an ordinary product, so the usual algebraic identities apply to vectors. ∎
16.2 Orthogonality
Definition 16.5(Orthogonal vectors)
Two vectors are orthogonal, written u⊥v, if u⋅v=0.
Remark 16.6
For nonzero vectors, formula 2 of Theorem 16.2 shows u⋅v=0⟺cosθ=0⟺ the directions are perpendicular. The zero vector is orthogonal to everything.
Example 16.7
u(3,2) and v(−4,6): u⋅v=−12+12=0: orthogonal. In general, u(a,b) is always orthogonal to v(−b,a) — a quarter-turn rotation.
16.3 The law of cosines
Theorem 16.8(Law of cosines)
In a triangle ABC with sides a=BC, b=CA, c=AB and angle A at the vertex A:
When A is a right angle, cosA=0 and the law of cosines reduces to the Pythagorean theorem a2=b2+c2: it is Pythagoras with a correction term for non-right angles.
The law of cosines: knowing two sides b, c and the angle between them determines the third side a.
Example 16.10
Two sides of a triangle measure b=5 and c=8, enclosing an angle A=3π. Then
a2=25+64−2×5×8×21=89−40=49,
so a=7.
16.4 Applications: circles and perpendicular lines
Proposition 16.11(Circle with a given diameter)
A point M lies on the circle of diameter [AB] if and only if
MA⋅MB=0.
Proof. If M=A,B, the condition says the angle at M in the triangle AMB is right, and the points seeing a segment under a right angle are exactly those of the circle with that diameter. Here is a direct proof: let O be the midpoint of [AB] and r=2AB. Then MA=MO+OA and MB=MO+OB=MO−OA, so
MA⋅MB=MO2−OA2=MO2−r2,
which vanishes exactly when MO=r, i.e. when M is on the circle of center O and radius r. ∎
Proposition 16.12(Normal vector of a line)
The vectorn(a,b) is orthogonal to every direction vector of the line d:ax+by+c=0; one says n is a normal vector of d. Two lines are perpendicular exactly when their normal (or direction) vectors are orthogonal.
Line through A with normal n(a,b): write AM⋅n=0, which expands to ax+by+c=0 with c determined by A.
Perpendicularity of d:ax+by+c=0 and d′:a′x+b′y+c′=0: check aa′+bb′=0.
Example 16.14
The line through P(2,−1) perpendicular to d:3x−y+4=0: a direction vector of d is (1,3), which serves as normalvector of the perpendicular. Equation: x+3y+c=0 with 2−3+c=0, so c=1: the line is x+3y+1=0.
Example 16.15(Equation of a circle)
The circle of center Ω(1,2) and radius 3 is the set of points M(x,y) with ΩM2=9:
(x−1)2+(y−2)2=9.
Conversely, x2+y2−2x−4y−4=0 rewrites, completing the squares (Chapter 10), as (x−1)2+(y−2)2=9: the same circle.
ABC is an equilateral triangle of side 6. Compute AB⋅AC and AB⋅BC.
Solution
Solution of Exercise 16.2.
AB⋅AC=6×6×cos60∘=18.
The vectorsAB and BC make an angle of 180∘−60∘=120∘ (place them tail to tail at B), so AB⋅BC=36cos120∘=−18.
Exercise 16.3★
For which value of t are u(3,t) and v(t−8,1)orthogonal? And for which value(s) of t is u(t,2)orthogonal to itself minus v(4,2), i.e. u⊥(u−v)?
Solution
Solution of Exercise 16.3.
u⋅v=3(t−8)+t=4t−24=0 gives t=6.
u−v=(t−4,0), so u⋅(u−v)=t(t−4)+0=t2−4t, which vanishes for t=0 or t=4.
Exercise 16.4★
Compute the angle θ between u(1,2) and v(3,1) (give cosθ exactly, then θ to the nearest degree).
Solution
Solution of Exercise 16.4.
u⋅v=3+2=5, ∥u∥=5, ∥v∥=10, so
cosθ=5105=525=22,
hence θ=45∘ exactly.
Exercise 16.5★★
A triangle has sides b=4, c=6 and angle A=32π between them. Compute the third side a. Then, in a triangle with sides a=7, b=5, c=4, compute cosA and decide whether A is acute or obtuse.
Solution
Solution of Exercise 16.5.
a2=16+36−2×4×6×cos32π=52−48×(−21)=76, so a=76=219≈8.7.
For the second triangle, the law of cosines solved for the angle gives
cosA=2bcb2+c2−a2=2×5×425+16−49=−408=−51,
negative: A is obtuse.
Exercise 16.6★★
Let A(1,1), B(5,−1) and C(3,5). Compute AB⋅AC; is the angle A right? Compute the three side lengths and check your answer with the law of cosines.
Solution
Solution of Exercise 16.6.
AB(4,−2) and AC(2,4): AB⋅AC=8−8=0, so the angle at A is right. Sides: AB=16+4=20, AC=4+16=20, and BC(−2,6) gives BC=40. Consistency: BC2=40=20+20=AB2+AC2, the law of cosines with cosA=0 (Pythagoras).
Exercise 16.7★★
Give an equation of the circle of center Ω(−2,3) and radius 5. Then determine the center and radius of the circle
Let A(−3,0) and B(0,2). Using Proposition 16.11, find an equation of the circle of diameter [AB], and check that the origin O(0,0) lies on it.
Solution
Solution of Exercise 16.8.
M(x,y) is on the circle when MA⋅MB=0 with MA(−3−x,−y) and MB(−x,2−y):
(−3−x)(−x)+(−y)(2−y)=x2+3x+y2−2y=0.
For the origin: 0+0+0−0=0, so O lies on the circle — geometrically, OA(−3,0) and OB(0,2) are orthogonal, so O sees [AB] under a right angle. (Completing the squares: center (−23,1), radius 213.)
Exercise 16.9★★
Find an equation of the line through P(1,3) perpendicular to d:2x+y−7=0, and the coordinates of the foot H of the perpendicular (the intersection of the two lines). Deduce the distance from P to d.
Solution
Solution of Exercise 16.9.
The perpendicular through P has the direction vector of d, namely (−1,2), as normal vector: equation−x+2y+c=0; through P(1,3): −1+6+c=0, c=−5, so x−2y+5=0.
Intersection with d: from 2x+y=7, y=7−2x; substituting, x−2(7−2x)+5=5x−9=0, so x=59, y=517: H(59,517). Then PH(54,52) and
PH=2516+254=520=525≈0.89.
Exercise 16.10★★
Using ∥u+v∥2=∥u∥2+2u⋅v+∥v∥2 and its analogue for u−v, prove the parallelogram identity:
∥u+v∥2+∥u−v∥2=2∥u∥2+2∥v∥2,
and interpret it in a parallelogram (diagonals versus sides).
Solution
Solution of Exercise 16.10.
Adding
∥u+v∥2=∥u∥2+2u⋅v+∥v∥2and∥u−v∥2=∥u∥2−2u⋅v+∥v∥2,
the cross terms cancel and ∥u+v∥2+∥u−v∥2=2∥u∥2+2∥v∥2. In a parallelogram with sides u and v, the diagonals are u+v and u−v: the sum of the squares of the two diagonals equals the sum of the squares of the four sides.
Exercise 16.11★★★
Let A and B be two points with AB=4, and I the midpoint of [AB].
Show that for every point M: MA⋅MB=MI2−4. (Insert I: MA=MI+IA.)
2. The condition MA⋅MB=12 becomes MI2=16, i.e. MI=4: the set is the circle of center I and radius 4.
16.6 Problem: Two gifts of the scalar product
Problem 16.1
Weekend problem — the addition formulas fall out of one dot product, the distance to a line out of another, and the three altitudes meet as a bonus
The scalar product looks like bookkeeping — multiply, add — yet it hands over, almost free of charge, two treasures that resisted centuries of angle-chasing: the addition formulas of trigonometry (compute cos15∘ exactly!) and the distance from a point to a line in one clean fraction. As a parting gift it proves that the three altitudes of every triangle pass through one point. All four faces of Theorem 16.2 will report for duty.
Part I — Fluency.
For u(3,4) and v(−1,2): compute u⋅v, the two norms, and the angle between the vectors (to the tenth of a degree).
Physics face: a sled is pulled 10 m by a 50 N force at 60∘ to the ground. Compute the work W=F⋅d.
Law of cosines (Theorem 16.8): two sides of 5 and 7 enclose an angle of 60∘; find the third side exactly.
Reverse: a triangle has sides 4, 6, 8. Compute the cosine of the angle opposite the side 8, classify the angle, and give it to the tenth of a degree.
Part II — First gift: the addition formulas. Let u=(cosa,sina) and v=(cosb,sinb): two unit vectors at angles a and b.
Compute u⋅v twice — once with coordinates, once with norms and the angle between the vectors — and conclude the mother formula:
cos(a−b)=cosacosb+sinasinb.
Substitute −b for b (parities of sine and cosine!) to obtain cos(a+b).
Obtain sin(a+b) from the complementary identity sinx=cos(2π−x) applied to x=a+b.
Exact values at last: compute cos15∘ (as cos(45∘−30∘)) and sin75∘. Check both numerically.
Set b=a to derive the double-angle formulas: cos2a (in its three forms) and sin2a.
From cos2a=1−2sin2a, compute sin215∘, then sin15∘ as a nested radical — and verify that its square agrees with the value 46−2 that question 9’s method gives.
Part III — Second gift: the distance to a line.
Let d be the line ax+by+c=0, with normal vectorn(a,b) (Proposition 16.12), and P(x0,y0) a point. Taking any point A on d, explain why the distance from P to d is ∥n∥AP⋅n, and deduce the formula
dist(P,d)=a2+b2∣ax0+by0+c∣.
Compute the distance from P(5,6) to 3x+4y−12=0.
Write the equation of the circle centered at (5,6)tangent to that line.
Cross-check the formula: compute the distance from the origin to 3x+4y−12=0, then verify it by computing the foot of the perpendicular from the origin explicitly.
Triangle A(0,0), B(6,0), C(2,5): compute its area using the base [AB]; then compute the distance from B to the line (AC) and check it reproduces the same area.
The circle of center (2,1) and radius 2, against the line x+y−6=0: compute the center’s distance to the line and classify their position (secant, tangent, disjoint).
Deduce Proposition 16.11 in one line: the set of points M with MA⋅MB=0 is the circle of diameter [AB].
The altitudes: let H be the intersection of the altitudes from A and from B in a triangle ABC (so HA⋅BC=0 and HB⋅CA=0). Prove the identity
HA⋅BC+HB⋅CA+HC⋅AB=0
— expand everything from H with Chasles — and conclude that H also lies on the altitude from C: the three altitudes are concurrent (at the orthocenter).
Finale: four faces, three trophies. Which face of Theorem 16.2 carried the addition formulas, which the distance formula, which the orthocenter — and why is “compute the same quantity twice” the motto of the whole chapter?
3.W=50×10×cos60∘=250 joules: only the component along the motion works.
4.c2=25+49−2×35×21=39: c=39.
5.cosγ=2×4×616+36−64=−41: negative, the angle is obtuse: γ≈104.5∘.
6.Coordinates: u⋅v=cosacosb+sinasinb. Geometry: two unit vectors, u⋅v=1×1×cos(a−b). Equating the two computations of the same number: cos(a−b)=cosacosb+sinasinb.
9.cos15∘=cos45∘cos30∘+sin45∘sin30∘=22⋅23+22⋅21=46+2≈0.966. And sin75∘=cos15∘: same value.
10.b=a in questions 7 and 8: cos2a=cos2a−sin2a=2cos2a−1=1−2sin2a (using cos2+sin2=1), and sin2a=2sinacosa.
11.sin215∘=21−cos30∘=42−3, so sin15∘=22−3. Squaring 46−2: 166−212+2=168−43=42−3: the same number in two costumes.
12.AP decomposes into a part along d (invisible to n) and a part perpendicular to d, whose length is the distance sought; dotting with the unit normal ∥n∥n kills the first part and measures the second. With A on d: AP⋅n=ax0+by0−(axA+byA)=ax0+by0+c, whence the formula. Example: 5∣15+24−12∣=527=5.4.
13. Radius =5.4: (x−5)2+(y−6)2=29.16.
14. Distance =5∣−12∣=2.4. Foot: the perpendicular through the origin is (3t,4t); on the line: 9t+16t=12, t=2512: foot (2536,2548), at distance 5t=2560=2.4. The formula and the honest computation agree.
15. Base AB=6, height = distance from C to (AB) (the axis y=0): 5; area 15. Line (AC): 5x−2y=0, and dist(B,(AC))=29∣30∣; then 21×AC×2930=21×29×2930=15: same area, either altitude.
16.dist=2∣2+1−6∣=23≈2.12>2: the line passes clear of the circle — disjoint.
17. Insert I: MA⋅MB=(MI+IA)⋅(MI+IB)=MI2+MI⋅(IA+IB)+IA⋅IB. The middle term dies (IA+IB=0), and IA⋅IB=−IA2=−4AB2 (opposite vectors of length 2AB).
18.MA⋅MB=0⟺MI2=4AB2⟺MI=2AB: the circle of center I and radius 2AB — the circle with diameter [AB].
everything cancels in pairs — the identity holds for any four points. For our H, the first two dot products vanish by hypothesis, so HC⋅AB=0: H lies on the altitude from C. Three altitudes, one point.
20. The addition formulas came from computing one dot product with the coordinate face and the norms-and-angle face; the distance formula from the projection face; the orthocenter from the bilinearity (Chasles-and-expand) face. Compute the same quantity twice, equate, and a theorem falls out — the scalar product’s whole trade.