Worked examples
The question
Question: find the dot product of (1, 2, 3) and (4, โ5, 6).
u = [1; 2; 3], v = [4; โ5; 6]
The dot product u dot v: multiply matching entries, top with top and so on.
Then add them all.
The answer is one number.
u โข v: matching entries multiplied, then added
1 Multiply matching entries
1 ร 4 + 2 ร (โ5) + 3 ร 6.
u โข v = 1 ร 4 + 2 ร (โ5) + 3 ร 6
We work out each times.
u โข v = 4 โ 10 + 18
2 Add them
Then we add: u โข v = 12.
u โข v = 12
Careful!
The dot product is one number, not a vector.
The products are added together.
Careful: one number, not a vector
3 Check
Let's check the other way round: v dot u.
The same products, so the same number.
v โข u = 4 ร 1 + (โ5) ร 2 + 6 ร 3
= 4 โ 10 + 18 = 12
We get 12 again.
So the answer is right!
Let's look back.
First: multiply matching entries.
Then: add them.
Last: check.
Answer Careful: one number, not a vector
โถ Watch it solved
The question
Question: are (1, 2, 3) and (1, 1, 1) orthogonal?
u = [1; 2; 3], v = [1; 1; 1]
Orthogonal means perpendicular: at a right angle.
Two vectors are orthogonal exactly when their dot product is 0.
orthogonal: at a right angle (perpendicular)
u โข v = 0
1 Find the dot product
Matching entries multiplied, then added: 1 ร 1 + 2 ร 1 + 3 ร 1.
u โข v = 1 ร 1 + 2 ร 1 + 3 ร 1
We work out each times.
u โข v = 1 + 2 + 3
Then we add: u โข v = 6.
u โข v = 6
2 Compare with 0
The dot product is 6, not 0.
So the vectors are not orthogonal.
= not orthogonal
Careful!
Only a dot product of exactly 0 means orthogonal.
Any other number, even a small one, means not.
Careful: orthogonal: the dot product is exactly 0
3 Check
Let's check with Pythagoras.
At a right angle, the length of u squared plus the length of v squared equals the length of u plus v, squared.
right angle: โuโ2 + โvโ2 = โu + vโ2
The length squared is the entries squared, added.
For u: 14.
โuโยฒ = 12 + 22 + 32 = 1 + 4 + 9 = 14
For v: 3.
โvโยฒ = 12 + 12 + 12 = 1 + 1 + 1 = 3
u plus v: (2, 3, 4).
u + v = [2; 3; 4]
Its length squared: 29.
โu + vโยฒ = 22 + 32 + 42 = 4 + 9 + 16 = 29
14 plus 3 is 17, not 29.
Pythagoras fails: no right angle.
So the answer is right!
14 + 3 = 17 โ 29
Let's look back.
First: find the dot product.
Then: compare with 0.
Last: check.
Answer Careful: orthogonal: the dot product is exactly 0
โถ Watch it solved
The question
Question: are (3, โ2, 1) and (1, 2, 1) perpendicular?
u = [3; โ2; 1], v = [1; 2; 1]
Orthogonal means perpendicular: at a right angle.
Two vectors are orthogonal exactly when their dot product is 0.
orthogonal: at a right angle (perpendicular)
u โข v = 0
1 Find the dot product
Matching entries multiplied, then added: 3 ร 1 + (โ2) ร 2 + 1 ร 1.
u โข v = 3 ร 1 + (โ2) ร 2 + 1 ร 1
We work out each times.
u โข v = 3 โ 4 + 1
Then we add: u โข v = 0.
u โข v = 0
2 Compare with 0
The dot product is 0.
So yes: the vectors are orthogonal.
= orthogonal
Careful!
Only a dot product of exactly 0 means orthogonal.
Any other number, even a small one, means not.
Careful: orthogonal: the dot product is exactly 0
3 Check
Let's check with Pythagoras.
At a right angle, the length of u squared plus the length of v squared equals the length of u plus v, squared.
right angle: โuโ2 + โvโ2 = โu + vโ2
The length squared is the entries squared, added.
For u: 14.
โuโยฒ = 32 + (โ2)2 + 12 = 9 + 4 + 1 = 14
For v: 6.
โvโยฒ = 12 + 22 + 12 = 1 + 4 + 1 = 6
u plus v: (4, 0, 2).
u + v = [4; 0; 2]
Its length squared: 20.
โu + vโยฒ = 42 + 02 + 22 = 16 + 0 + 4 = 20
14 plus 6 is 20, the same as 20.
Pythagoras works: a right angle.
So the answer is right!
14 + 6 = 20 = 20
Let's look back.
First: find the dot product.
Then: compare with 0.
Last: check.
Answer Careful: orthogonal: the dot product is exactly 0
โถ Watch it solved