Linear AlgebraDot and Cross Products3 of 5
Dot and Cross Products · 3

Angle and Orthogonality

We know how to compute the dot product from coordinates, and now we need to use it to find the angle between two vectors, even when they have too many coordinates to draw.

1

The Dot Product as the Pythagorean Leftover

Before finding an exact number of degrees, we want a way to tell from the coordinates alone whether two vectors meet at a 90∘90^\circ right angle, or whether the angle between them is under or over 90∘90^\circ. Let's start with A=[31]\first{A} = \first{\begin{bmatrix} 3 \\ 1 \end{bmatrix}} and B=[24]\second{B} = \second{\begin{bmatrix} 2 \\ 4 \end{bmatrix}}.

The Dot Product as the Pythagorean Leftover
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
A\htmlClass{lc-green}{A}
B\htmlClass{lc-pink}{B}
[31]\htmlClass{lc-green}{\begin{bmatrix} 3 \\ 1 \end{bmatrix}}
[24]\htmlClass{lc-pink}{\begin{bmatrix} 2 \\ 4 \end{bmatrix}}
??

When we add A\first{A} and B\second{B} tip-to-tail, the third side of the triangle is A+B\thirdside{A + B}. To compare ∥A+B∥2\thirdside{\|A + B\|^2} with ∥A∥2+∥B∥2\first{\|A\|^2} + \second{\|B\|^2}, we expand the squared coordinates using (a+b)2=a2+2ab+b2(\first{a} + \second{b})^2 = \first{a}^2 + 2\first{a}\second{b} + \second{b}^2 instead of adding the numbers first:

∥A+B∥2\displaystyle \thirdside{\|A + B\|^2} =∥A∥2+∥B∥2+2(A⋅B)⏟Pythagorean leftover\displaystyle = \first{\|A\|^2} + \second{\|B\|^2} + \underbrace{2(\first{A} \cdot \second{B})}_{\text{Pythagorean leftover}}
Text solution
Square the length of the sumKeep the coordinates of A=[31]\first{A} = \first{\begin{bmatrix} 3 \\ 1 \end{bmatrix}} and B=[24]\second{B} = \second{\begin{bmatrix} 2 \\ 4 \end{bmatrix}} separate inside ∥A+B∥2\thirdside{\|A + B\|^2} so we can see what gets added beyond ∥A∥2\first{\|A\|^2} and ∥B∥2\second{\|B\|^2}.
∥A+B∥2\displaystyle \thirdside{\|A + B\|^2} =(3+2)2+(1+4)2\displaystyle = (\first{3} + \second{2})^2 + (\first{1} + \second{4})^2
Expand the squares and group the leftoverMultiply out both brackets and move the middle 2ab2\first{a}\second{b} terms to the end to put the dot product by itself.
∥A+B∥2=(32+2⋅3⋅2+22)+(12+2⋅1⋅4+42)=(32+12)⏟∥A∥2=10+(22+42)⏟∥B∥2=20+2(3⋅2+1⋅4)⏟A⋅B=10\displaystyle \begin{aligned} \thirdside{\|A + B\|^2} &= (\first{3}^2 + 2 \cdot \first{3} \cdot \second{2} + \second{2}^2) \\ &\quad + (\first{1}^2 + 2 \cdot \first{1} \cdot \second{4} + \second{4}^2) \\[4pt] &= \underbrace{(\first{3}^2 + \first{1}^2)}_{\first{\|A\|^2} = 10} + \underbrace{(\second{2}^2 + \second{4}^2)}_{\second{\|B\|^2} = 20} \\ &\quad + 2\underbrace{(\first{3} \cdot \second{2} + \first{1} \cdot \second{4})}_{\first{A} \cdot \second{B} = 10} \end{aligned}
Check the sign of the dot productBecause the leftover 2(A⋅B)2(\first{A} \cdot \second{B}) is positive, the third side A+B\thirdside{A + B} is longer than the hypotenuse of a right triangle, so the angle between A\first{A} and B\second{B} is under 90∘90^\circ.
A⋅B\displaystyle \first{A} \cdot \second{B} =10>0  ⟹  angle is under 90∘\displaystyle = 10 > 0 \implies \text{angle is under } 90^\circ

If we keep the lengths ∥A∥\first{\|A\|} and ∥B∥\second{\|B\|} fixed and change the angle between them, the leftover 2(A⋅B)2(\first{A} \cdot \second{B}) tracks how ∥A+B∥2\thirdside{\|A + B\|^2} compares to ∥A∥2+∥B∥2\first{\|A\|^2} + \second{\|B\|^2}. It is zero right at 90∘90^\circ, turns positive below 90∘90^\circ as the third side A+B\thirdside{A + B} stretches out, and turns negative above 90∘90^\circ as A+B\thirdside{A + B} shrinks.

With the lengths of the two vectors held fixed, changing the angle between them stretches or shrinks their sum, and the leftover dot-product piece is the exact difference between the squared length of their sum and the two squared lengths added together.
2

Orthogonal Vectors in 2D and 3D

Two vectors are orthogonal when they meet at a 90∘90^\circ angle, which happens in any number of dimensions whenever the Pythagorean leftover is zero:

A⋅B=0⏟orthogonal (90∘)\displaystyle \underbrace{\first{A} \cdot \second{B} = 0}_{\text{orthogonal }(90^\circ)}

When A⋅B=0\first{A} \cdot \second{B} = 0, we can use that to build a perpendicular vector right away on a 2D plane, or to test whether two 3D vectors meet at 90∘90^\circ without trying to draw them in 3D.

Orthogonal Vectors in 2D and 3D
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
A\htmlClass{lc-green}{A}
[31]\htmlClass{lc-green}{\begin{bmatrix} 3 \\ 1 \end{bmatrix}}
A⋅[ ?  ? ]=0\htmlClass{lc-green}{A} \cdot \htmlClass{lc-pink}{\begin{bmatrix} \,?\, \\ \,?\, \end{bmatrix}} = 0
x\htmlClass{lc-mute}{x}
y\htmlClass{lc-mute}{y}
A\htmlClass{lc-green}{A}
[31]\htmlClass{lc-green}{\begin{bmatrix} 3 \\ 1 \end{bmatrix}}
[−13]\htmlClass{lc-pink}{\begin{bmatrix} -1 \\ 3 \end{bmatrix}}
[1−3]\htmlClass{lc-pink}{\begin{bmatrix} 1 \\ -3 \end{bmatrix}}
Text solution
Swap coordinates and flip one sign in 2DTo make the dot product with A=[31]\first{A} = \first{\begin{bmatrix} 3 \\ 1 \end{bmatrix}} cancel to zero, swap the two entries and flip the sign of either one to get [−13]\second{\begin{bmatrix} -1 \\ 3 \end{bmatrix}} or [1−3]\second{\begin{bmatrix} 1 \\ -3 \end{bmatrix}}.
(3)(−1)+(1)(3)\displaystyle (\first{3})(\second{-1}) + (\first{1})(\second{3}) =−3+3\displaystyle = -3 + 3 =0\displaystyle = 0
Multiply and add matching coordinates in 3DTo check whether [2−12]\first{\begin{bmatrix} 2 \\ -1 \\ 2 \end{bmatrix}} and [141]\second{\begin{bmatrix} 1 \\ 4 \\ 1 \end{bmatrix}} meet at 90∘90^\circ, compute their dot product to see if it equals zero.
(2)(1)+(−1)(4)+(2)(1)\displaystyle (\first{2})(\second{1}) + (\first{-1})(\second{4}) + (\first{2})(\second{1}) =2−4+2\displaystyle = 2 - 4 + 2 =0\displaystyle = 0

So [2−12]\first{\begin{bmatrix} 2 \\ -1 \\ 2 \end{bmatrix}} and [141]\second{\begin{bmatrix} 1 \\ 4 \\ 1 \end{bmatrix}} are orthogonal.

3

Shadows and the Cosine Formula

The sign of A⋅B\first{A} \cdot \second{B} tells us which side of 90∘90^\circ the angle is on, but now we want the exact angle θ\theta between A\first{A} and B\second{B}. To get an angle that doesn't change when we make either vector longer, we split B\second{B} into a shadow along A\first{A}'s line plus a 90∘90^\circ height piece, and then divide by the lengths of both vectors.

Shadows and the Cosine Formula
A\htmlClass{lc-green}{A}
B\htmlClass{lc-pink}{B}
θ\theta
A⋅B=10θ=  ?\begin{aligned} \htmlClass{lc-green}{A} \cdot \htmlClass{lc-pink}{B} &= 10 \\ \theta &= \;? \end{aligned}
A\htmlClass{lc-green}{A}
B\htmlClass{lc-pink}{B}
∥B∥\htmlClass{lc-pink}{\|B\|}
θ\theta
Shadow=A⋅B∥A∥\htmlClass{lc-violet}{\text{Shadow}} = \dfrac{\htmlClass{lc-green}{A} \cdot \htmlClass{lc-pink}{B}}{\htmlClass{lc-green}{\|A\|}}
Height\htmlClass{lc-orange}{\text{Height}}

In the shadow right triangle, the adjacent side is B\second{B}'s shadow along A\first{A} and the hypotenuse is ∥B∥\second{\|B\|}, so cos⁡(θ)=AdjacentHypotenuse\shadow{\cos(\theta)} = \frac{\shadow{\text{Adjacent}}}{\second{\text{Hypotenuse}}} gives the fraction of B\second{B}'s length that falls along A\first{A}:

Length of B’s shadow on A=A⋅B∥A∥,cos⁡(θ)=A⋅B∥A∥∥B∥⏟shadow fraction\displaystyle \begin{aligned} & \shadow{\text{Length of } \second{B}\text{'s shadow on } \first{A}} \\ &= \frac{\first{A} \cdot \second{B}}{\first{\|A\|}}, \\ \shadow{\cos(\theta)} &= \underbrace{\frac{\first{A} \cdot \second{B}}{\first{\|A\|}\second{\|B\|}}}_{\text{shadow fraction}} \end{aligned}
Text solution
Find the dot product and both lengthsFor A=[31]\first{A} = \first{\begin{bmatrix} 3 \\ 1 \end{bmatrix}} and B=[24]\second{B} = \second{\begin{bmatrix} 2 \\ 4 \end{bmatrix}}, compute A⋅B\first{A} \cdot \second{B} along with the length of each vector from the coordinates.
A⋅B=(3)(2)+(1)(4)=10,∥A∥=32+12=10,∥B∥=22+42=20\displaystyle \begin{aligned} \first{A} \cdot \second{B} &= (\first{3})(\second{2}) + (\first{1})(\second{4}) = 10, \\ \first{\|A\|} &= \sqrt{\first{3}^2 + \first{1}^2} = \first{\sqrt{10}}, \\ \second{\|B\|} &= \sqrt{\second{2}^2 + \second{4}^2} = \second{\sqrt{20}} \end{aligned}
Divide by both lengths to get the shadow fractionMultiply the two numbers inside a single square root before simplifying so you can see the exact fraction.
cos⁡(θ)\displaystyle \shadow{\cos(\theta)} =101020\displaystyle = \frac{10}{\first{\sqrt{10}}\second{\sqrt{20}}} =10200\displaystyle = \frac{10}{\sqrt{200}} =10102\displaystyle = \frac{10}{10\sqrt{2}} =12≈0.707\displaystyle = \frac{1}{\sqrt{2}} \approx 0.707
Match the cosine to the angleAbout 70.7%70.7\% of B\second{B}'s length falls as a forward shadow along A\first{A}, which is the cosine of a 45∘45^\circ angle.
θ\displaystyle \theta =45∘\displaystyle = 45^\circ

Making B\second{B} longer or shorter along the same line changes A⋅B\first{A} \cdot \second{B}, but the shadow fraction cos⁡(θ)=A⋅B∥A∥∥B∥\shadow{\cos(\theta)} = \frac{\first{A} \cdot \second{B}}{\first{\|A\|}\second{\|B\|}} stays the same for that angle, and turns negative once B\second{B} rotates past 90∘90^\circ and casts its shadow backward behind A\first{A}.

Changing the length of B\second{B} changes the dot product, while the shadow fraction depends only on the angle and never goes past 100%100\% of B\second{B}’s length in either direction.
4

The Cauchy-Schwarz Inequality

For cos⁡(θ)=A⋅B∥A∥∥B∥\shadow{\cos(\theta)} = \frac{\first{A} \cdot \second{B}}{\first{\|A\|}\second{\|B\|}} to give a possible angle in any number of dimensions, that fraction can never go past −1-1 or 11. The Cauchy-Schwarz inequality says that the size of the dot product ∣A⋅B∣|\first{A} \cdot \second{B}| is always at most ∥A∥∥B∥\first{\|A\|}\second{\|B\|}.

The Cauchy-Schwarz Inequality
cos⁡(θ)\displaystyle \shadow{\cos(\theta)} =A⋅B∥A∥ ∥B∥\displaystyle = \frac{\first{A} \cdot \second{B}}{\first{\|A\|}\,\second{\|B\|}}
−1  ≤?  cos⁡(θ)  ≤?  1\displaystyle -1 \;\overset{?}{\le}\; \shadow{\cos(\theta)} \;\overset{?}{\le}\; 1

In the shadow right triangle, the squared height cannot be negative, so the shadow can never be longer than the vector B\second{B} casting it:

Shadow2+Height2⏟≥ 0\displaystyle \shadow{\text{Shadow}}^2 + \underbrace{\height{\text{Height}}^2}_{\ge \, 0} =∥B∥2  ⟹  ∣Shadow∣\displaystyle = \second{\|B\|}^2 \implies |\shadow{\text{Shadow}}| ≤∥B∥\displaystyle \le \second{\|B\|}

Even when vectors have too many coordinates to draw a triangle, we can divide A\first{A} and B\second{B} by their lengths to get unit vectors U=A∥A∥\first{U} = \first{\frac{A}{\|A\|}} and V=B∥B∥\second{V} = \second{\frac{B}{\|B\|}} of length 11. Since any squared length is zero or positive, ∥U+V∥2\thirdside{\|U + V\|^2} and ∥U−V∥2\thirdside{\|U - V\|^2} can never be negative:

∥U+V∥2=1+1+2(U⋅V)≥0  ⟹  U⋅V≥−1∥U−V∥2=1+1−2(U⋅V)≥0  ⟹  U⋅V≤1\displaystyle \begin{aligned} \thirdside{\|U + V\|^2} &= 1 + 1 + 2(\first{U} \cdot \second{V}) \ge 0 \\ &\implies \first{U} \cdot \second{V} \ge -1 \\[6pt] \thirdside{\|U - V\|^2} &= 1 + 1 - 2(\first{U} \cdot \second{V}) \ge 0 \\ &\implies \first{U} \cdot \second{V} \le 1 \end{aligned}

Multiplying back by ∥A∥∥B∥\first{\|A\|}\second{\|B\|} guarantees that an angle θ\theta always exists between any two non-zero vectors:

∣A⋅B∣≤∥A∥∥B∥⏟Cauchy-Schwarz inequality⟺−1\displaystyle \underbrace{|\first{A} \cdot \second{B}| \le \first{\|A\|}\second{\|B\|}}_{\text{Cauchy-Schwarz inequality}} \Longleftrightarrow -1 ≤A⋅B∥A∥∥B∥\displaystyle \le \frac{\first{A} \cdot \second{B}}{\first{\|A\|}\second{\|B\|}} ≤1\displaystyle \le 1

The dot product reaches +∥A∥∥B∥+\first{\|A\|}\second{\|B\|} only at θ=0∘\theta = 0^\circ (when B\second{B} points in the exact same direction as A\first{A}) and −∥A∥∥B∥-\first{\|A\|}\second{\|B\|} only at θ=180∘\theta = 180^\circ (when B\second{B} points in the exact opposite direction along A\first{A}'s line), where the perpendicular height drops to zero.

5

Angles and Orthogonality in Higher Dimensions

Now we want to find the exact angles between vectors in 4D space, where we cannot picture the vectors at all, using the exact same coordinate steps. Let's compare A=[1111]\first{A} = \first{\begin{bmatrix} 1 \\ 1 \\ 1 \\ 1 \end{bmatrix}} with B=[111−1]\second{B} = \second{\begin{bmatrix} 1 \\ 1 \\ 1 \\ -1 \end{bmatrix}}, C=[11−1−1]\second{C} = \second{\begin{bmatrix} 1 \\ 1 \\ -1 \\ -1 \end{bmatrix}}, and D=[1−1−1−1]\second{D} = \second{\begin{bmatrix} 1 \\ -1 \\ -1 \\ -1 \end{bmatrix}} as we flip one sign at a time.

Angles and Orthogonality in Higher Dimensions
A[1111]B[111−1] C[11−1−1] D[1−1−1−1]\displaystyle \begin{matrix} \first{A} \\[2pt] \first{\begin{bmatrix} 1 \\ 1 \\ 1 \\ 1 \end{bmatrix}} \end{matrix} \quad \begin{matrix} \second{B} \\[2pt] \second{\begin{bmatrix} 1 \\ 1 \\ 1 \\ -1 \end{bmatrix}} \end{matrix} \, \begin{matrix} \second{C} \\[2pt] \second{\begin{bmatrix} 1 \\ 1 \\ -1 \\ -1 \end{bmatrix}} \end{matrix} \, \begin{matrix} \second{D} \\[2pt] \second{\begin{bmatrix} 1 \\ -1 \\ -1 \\ -1 \end{bmatrix}} \end{matrix}
θ from A to B, C, D\displaystyle \theta \text{ from } \first{A} \text{ to } \second{B},\ \second{C},\ \second{D} =  ?\displaystyle = \;?
Text solution
Find the length of each 4D vectorEvery coordinate in A\first{A}, B\second{B}, C\second{C}, and D\second{D} is 11 or −1-1, so squaring and adding the four coordinates gives a length of 22 for each vector.
∥A∥\displaystyle \first{\|A\|} =12+12+12+12\displaystyle = \sqrt{\first{1}^2 + \first{1}^2 + \first{1}^2 + \first{1}^2} =4\displaystyle = \sqrt{4} =2\displaystyle = \first{2}
One negative sign (B\second{B}) gives a forward 50%50\% shadowDivide A⋅B\first{A} \cdot \second{B} by both lengths to find the positive shadow fraction and an angle under 90∘90^\circ.
A⋅B\displaystyle \first{A} \cdot \second{B} =1+1+1−1\displaystyle = 1 + 1 + 1 - 1 =2  ⟹  cos⁡(θ)\displaystyle = 2 \implies \shadow{\cos(\theta)} =22×2\displaystyle = \frac{2}{\first{2} \times \second{2}} =12  ⟹  θ\displaystyle = \frac{1}{2} \implies \theta =60∘\displaystyle = 60^\circ
Two negative signs (C\second{C}) cancel to zeroWhen the dot product is zero, stop without dividing by the lengths because the vectors are already orthogonal.
A⋅C\displaystyle \first{A} \cdot \second{C} =1+1−1−1\displaystyle = 1 + 1 - 1 - 1 =0  ⟹  θ\displaystyle = 0 \implies \theta =90∘\displaystyle = 90^\circ
Three negative signs (D\second{D}) flip the 50%50\% shadow backwardA negative dot product puts the shadow behind A\first{A}, giving an angle over 90∘90^\circ.
A⋅D\displaystyle \first{A} \cdot \second{D} =1−1−1−1\displaystyle = 1 - 1 - 1 - 1 =−2  ⟹  cos⁡(θ)\displaystyle = -2 \implies \shadow{\cos(\theta)} =−22×2\displaystyle = \frac{-2}{\first{2} \times \second{2}} =−12  ⟹  θ\displaystyle = -\frac{1}{2} \implies \theta =120∘\displaystyle = 120^\circ

Key concepts

Always start with the dot product A⋅B\first{A} \cdot \second{B}, and stop there if the question only asks whether vectors are orthogonal or whether the angle is under, at, or over 90∘90^\circ. Computing the lengths ∥A∥\first{\|A\|} and ∥B∥\second{\|B\|} is extra work when the sign of A⋅B\first{A} \cdot \second{B} already answers the question. For A=[1111]\first{A} = \first{\begin{bmatrix} 1 \\ 1 \\ 1 \\ 1 \end{bmatrix}} and C=[11−1−1]\second{C} = \second{\begin{bmatrix} 1 \\ 1 \\ -1 \\ -1 \end{bmatrix}}, A⋅C=0\first{A} \cdot \second{C} = 0 tells you right away that θ=90∘\theta = 90^\circ, while A⋅B>0\first{A} \cdot \second{B} > 0 means under 90∘90^\circ and A⋅D<0\first{A} \cdot \second{D} < 0 means over 90∘90^\circ. On a 2D plane, you can build an orthogonal vector to A=[31]\first{A} = \first{\begin{bmatrix} 3 \\ 1 \end{bmatrix}} in one step by swapping the coordinates and flipping one sign to get [−13]\second{\begin{bmatrix} -1 \\ 3 \end{bmatrix}} or [1−3]\second{\begin{bmatrix} 1 \\ -3 \end{bmatrix}}.

Bring in the vector lengths only when you need an actual shadow length or an exact angle θ\theta. Dividing A⋅B\first{A} \cdot \second{B} by ∥A∥\first{\|A\|} divides out A\first{A}'s length to leave the signed length of B\second{B}'s shadow along A\first{A}, and dividing by ∥B∥\second{\|B\|} as well gives the shadow fraction cos⁡(θ)\shadow{\cos(\theta)}:

Shadow=A⋅B∥A∥,cos⁡(θ)=A⋅B∥A∥∥B∥,Shadow2+Height2=∥B∥2\displaystyle \begin{aligned} \shadow{\text{Shadow}} &= \frac{\first{A} \cdot \second{B}}{\first{\|A\|}}, \\ \shadow{\cos(\theta)} &= \frac{\first{A} \cdot \second{B}}{\first{\|A\|}\second{\|B\|}}, \\ \shadow{\text{Shadow}}^2 + \height{\text{Height}}^2 &= \second{\|B\|}^2 \end{aligned}

For A=[31]\first{A} = \first{\begin{bmatrix} 3 \\ 1 \end{bmatrix}} and B=[24]\second{B} = \second{\begin{bmatrix} 2 \\ 4 \end{bmatrix}}, cos⁡(θ)=101020=12\shadow{\cos(\theta)} = \frac{10}{\first{\sqrt{10}}\second{\sqrt{20}}} = \frac{1}{\sqrt{2}}, so θ=45∘\theta = 45^\circ. If a problem gives you the lengths ∥A∥\first{\|A\|}, ∥B∥\second{\|B\|}, and ∥A+B∥\thirdside{\|A + B\|} instead of coordinates, find A⋅B\first{A} \cdot \second{B} from the Pythagorean expansion ∥A+B∥2=∥A∥2+∥B∥2+2(A⋅B)\thirdside{\|A + B\|^2} = \first{\|A\|^2} + \second{\|B\|^2} + 2(\first{A} \cdot \second{B}). And because B\second{B}'s shadow can never be more than 100%100\% of B\second{B}'s length, Cauchy-Schwarz guarantees ∣A⋅B∣≤∥A∥∥B∥|\first{A} \cdot \second{B}| \le \first{\|A\|}\second{\|B\|}, reaching +∥A∥∥B∥+\first{\|A\|}\second{\|B\|} only at θ=0∘\theta = 0^\circ and −∥A∥∥B∥-\first{\|A\|}\second{\|B\|} only at θ=180∘\theta = 180^\circ.

6

Practice

1

Swap the coordinates and flip one sign to find two vectors orthogonal to A=[4−7]\first{A} = \first{\begin{bmatrix} 4 \\ -7 \end{bmatrix}}, and check both with the dot product.

After you swap the two entries of A\first{A}, how many signs should you flip so the two products have opposite signs and cancel?

Swap 4\first{4} and −7\first{-7} to get [−74]\begin{bmatrix} -7 \\ 4 \end{bmatrix}, then flip one sign at a time to get [74]\second{\begin{bmatrix} 7 \\ 4 \end{bmatrix}} and [−7−4]\second{\begin{bmatrix} -7 \\ -4 \end{bmatrix}} (watch out for flipping both signs to write [7−4]\begin{bmatrix} 7 \\ -4 \end{bmatrix}, which makes the products add to 28+28=5628 + 28 = 56 instead of canceling). Checking the dot products gives:
(4)(7)+(−7)(4)=28−28=0,(4)(−7)+(−7)(−4)=−28+28=0\displaystyle \begin{aligned} (\first{4})(\second{7}) + (\first{-7})(\second{4}) &= 28 - 28 = 0, \\ (\first{4})(\second{-7}) + (\first{-7})(\second{-4}) &= -28 + 28 = 0 \end{aligned}
2

Without computing any vector lengths, tell whether the angle between A=[3−21]\first{A} = \first{\begin{bmatrix} 3 \\ -2 \\ 1 \end{bmatrix}} and each vector is under 90∘90^\circ, exactly 90∘90^\circ (orthogonal), or over 90∘90^\circ: (a) B=[121]\second{B} = \second{\begin{bmatrix} 1 \\ 2 \\ 1 \end{bmatrix}}, (b) C=[214]\second{C} = \second{\begin{bmatrix} 2 \\ 1 \\ 4 \end{bmatrix}}, (c) D=[−121]\second{D} = \second{\begin{bmatrix} -1 \\ 2 \\ 1 \end{bmatrix}}.

Does A⋅B\first{A} \cdot \second{B} tell you how ∥A+B∥2\thirdside{\|A + B\|^2} compares to ∥A∥2+∥B∥2\first{\|A\|^2} + \second{\|B\|^2}?

(a) A⋅B\first{A} \cdot \second{B} =(3)(1)+(−2)(2)+(1)(1){}= (\first{3})(\second{1}) + (\first{-2})(\second{2}) + (\first{1})(\second{1}) =3−4+1=0{}= 3 - 4 + 1 = 0, so exactly 90∘90^\circ (orthogonal). (b) A⋅C\first{A} \cdot \second{C} =(3)(2)+(−2)(1)+(1)(4){}= (\first{3})(\second{2}) + (\first{-2})(\second{1}) + (\first{1})(\second{4}) =6−2+4=8>0{}= 6 - 2 + 4 = 8 > 0. Don't mistake a positive dot product for an angle above 90∘90^\circ. A positive leftover means the vectors point roughly the same way, so under 90∘90^\circ. (c) A⋅D\first{A} \cdot \second{D} =(3)(−1)+(−2)(2)+(1)(1){}= (\first{3})(\second{-1}) + (\first{-2})(\second{2}) + (\first{1})(\second{1}) =−3−4+1=−6<0{}= -3 - 4 + 1 = -6 < 0, so over 90∘90^\circ.
3

Find the number kk that makes the 4D vectors A=[2−341]\first{A} = \first{\begin{bmatrix} 2 \\ -3 \\ 4 \\ 1 \end{bmatrix}} and B=[3k1−1]\second{B} = \begin{bmatrix} \second{3} \\ k \\ \second{1} \\ \second{-1} \end{bmatrix} orthogonal.

Write out the dot product A⋅B\first{A} \cdot \second{B} in terms of kk. What must that sum equal for a 90∘90^\circ angle?

Set the dot product equal to zero:
A⋅B\displaystyle \first{A} \cdot \second{B} =(2)(3)+(−3)(k)+(4)(1)+(1)(−1)\displaystyle = (\first{2})(\second{3}) + (\first{-3})(k) + (\first{4})(\second{1}) + (\first{1})(\second{-1}) =9−3k\displaystyle = 9 - 3k =0\displaystyle = 0
Be careful not to drop the negative sign on −3\first{-3} when multiplying by kk (writing 9+3k=09 + 3k = 0 gives the wrong answer k=−3k = -3). Solving 9−3k=09 - 3k = 0 gives k=3k = 3.
4

For A=[340]\first{A} = \first{\begin{bmatrix} 3 \\ 4 \\ 0 \end{bmatrix}} and B=[345]\second{B} = \second{\begin{bmatrix} 3 \\ 4 \\ 5 \end{bmatrix}}, find the length of B\second{B}'s shadow along A\first{A}, the length of B\second{B}'s perpendicular height piece from the shadow triangle, and the exact angle θ\theta between A\first{A} and B\second{B}.

When you divide A⋅B\first{A} \cdot \second{B} by a single length to get B\second{B}'s shadow on A\first{A}, should you divide by ∥A∥\first{\|A\|} or ∥B∥\second{\|B\|}?

First find A⋅B=(3)(3)+(4)(4)+(0)(5)=25\first{A} \cdot \second{B} = (\first{3})(\second{3}) + (\first{4})(\second{4}) + (\first{0})(\second{5}) = 25 and ∥A∥=32+42+02=5\first{\|A\|} = \sqrt{\first{3}^2 + \first{4}^2 + \first{0}^2} = \first{5}. Divide by ∥A∥\first{\|A\|} to get B\second{B}'s shadow length (dividing by ∥B∥=50\second{\|B\|} = \second{\sqrt{50}} instead would give A\first{A}'s shadow on B\second{B}, 52\frac{5}{\sqrt{2}}):
Shadow\displaystyle \shadow{\text{Shadow}} =A⋅B∥A∥\displaystyle = \frac{\first{A} \cdot \second{B}}{\first{\|A\|}} =255\displaystyle = \frac{25}{\first{5}} =5\displaystyle = 5
Since ∥B∥2=32+42+52=50\second{\|B\|^2} = \second{3}^2 + \second{4}^2 + \second{5}^2 = \second{50} and Shadow2+Height2=∥B∥2\shadow{\text{Shadow}}^2 + \height{\text{Height}}^2 = \second{\|B\|}^2, we get Height2=50−25=25\height{\text{Height}}^2 = \second{50} - \shadow{25} = 25 (take the square root here rather than leaving the height as 2525), so:
Height\displaystyle \height{\text{Height}} =50−25\displaystyle = \sqrt{\second{50} - \shadow{25}} =5\displaystyle = 5
Then cos⁡(θ)=550=12\shadow{\cos(\theta)} = \frac{\shadow{5}}{\second{\sqrt{50}}} = \frac{1}{\sqrt{2}}, which gives θ=45∘\theta = 45^\circ.
5

In 4D space, find the shadow fraction cos⁡(θ)\shadow{\cos(\theta)} and the exact angle θ\theta between A=[1224]\first{A} = \first{\begin{bmatrix} 1 \\ 2 \\ 2 \\ 4 \end{bmatrix}} and B=[−11−1−1]\second{B} = \second{\begin{bmatrix} -1 \\ 1 \\ -1 \\ -1 \end{bmatrix}}.

After finding A⋅B\first{A} \cdot \second{B}, watch what happens to the negative signs when you square the entries of B\second{B} to find ∥B∥\second{\|B\|}.

Compute the dot product and both lengths:
A⋅B=−1+2−2−4=−5,∥A∥=1+4+4+16=5,∥B∥=1+1+1+1=2\displaystyle \begin{aligned} \first{A} \cdot \second{B} &= -1 + 2 - 2 - 4 = -5, \\ \first{\|A\|} &= \sqrt{\first{1} + \first{4} + \first{4} + \first{16}} = \first{5}, \\ \second{\|B\|} &= \sqrt{\second{1} + \second{1} + \second{1} + \second{1}} = \second{2} \end{aligned}
Take the square roots for ∥A∥\first{\|A\|} and ∥B∥\second{\|B\|} before dividing (using the squared lengths 25×4=10025 \times 4 = 100 gives −120-\frac{1}{20}):
cos⁡(θ)\displaystyle \shadow{\cos(\theta)} =−55×2\displaystyle = \frac{-5}{\first{5} \times \second{2}} =−12\displaystyle = -\frac{1}{2}
Don't drop the minus sign on −12-\frac{1}{2} and answer 60∘60^\circ. A 50%50\% shadow falling backward behind A\first{A} makes the angle over 90∘90^\circ, giving θ=120∘\theta = 120^\circ.
6

Two vectors in 10D space have lengths ∥A∥=3\first{\|A\|} = \first{3} and ∥B∥=4\second{\|B\|} = \second{4}, and their sum has length ∥A+B∥=13\thirdside{\|A + B\|} = \thirdside{\sqrt{13}}. Find A⋅B\first{A} \cdot \second{B} and the angle θ\theta between A\first{A} and B\second{B}.

You aren't given the 10 coordinates, so write out the Pythagorean expansion ∥A+B∥2=∥A∥2+∥B∥2+2(A⋅B)\thirdside{\|A + B\|^2} = \first{\|A\|^2} + \second{\|B\|^2} + 2(\first{A} \cdot \second{B}).

Put the squared lengths into ∥A+B∥2=∥A∥2+∥B∥2+2(A⋅B)\thirdside{\|A + B\|^2} = \first{\|A\|^2} + \second{\|B\|^2} + 2(\first{A} \cdot \second{B}):
13\displaystyle \thirdside{13} =9+16+2(A⋅B)  ⟹  2(A⋅B)\displaystyle = \first{9} + \second{16} + 2(\first{A} \cdot \second{B}) \implies 2(\first{A} \cdot \second{B}) =−12\displaystyle = -12
Don't forget to divide by the 22 in front of A⋅B\first{A} \cdot \second{B} (leaving A⋅B=−12\first{A} \cdot \second{B} = -12 gives cos⁡(θ)=−1\shadow{\cos(\theta)} = -1 and 180∘180^\circ):
A⋅B\displaystyle \first{A} \cdot \second{B} =−6\displaystyle = -6
Then cos⁡(θ)=−63×4=−12\shadow{\cos(\theta)} = \frac{-6}{\first{3} \times \second{4}} = -\frac{1}{2}, so θ=120∘\theta = 120^\circ.
7

Two vectors in 50D space have lengths ∥A∥=6\first{\|A\|} = \first{6} and ∥B∥=5\second{\|B\|} = \second{5}. (a) Can A⋅B\first{A} \cdot \second{B} equal 3535? Explain why or why not. (b) If A⋅B=−30\first{A} \cdot \second{B} = -30, what is the angle θ\theta between A\first{A} and B\second{B}, and how do the two vectors point relative to each other?

What is the largest shadow B\second{B} can possibly cast along A\first{A}, and what is the largest value ∣A⋅B∣|\first{A} \cdot \second{B}| can have?

(a) No; by the Cauchy-Schwarz inequality, ∣A⋅B∣≤∥A∥∥B∥=6×5=30|\first{A} \cdot \second{B}| \le \first{\|A\|}\second{\|B\|} = \first{6} \times \second{5} = 30 (don't compare 3535 to the squared product ∥A∥2∥B∥2=900\first{\|A\|^2}\second{\|B\|^2} = 900), because B\second{B}'s shadow cannot be longer than B\second{B} itself. (b) cos⁡(θ)=−3030=−1\shadow{\cos(\theta)} = \frac{-30}{30} = -1. Watch the negative sign on −30-30 so you don't answer 0∘0^\circ (same direction): cos⁡(θ)=−1\shadow{\cos(\theta)} = -1 means B\second{B} points in the exact opposite direction along the line of A\first{A} with zero perpendicular height, at θ=180∘\theta = 180^\circ.