Scalar product of two vectors is an operation on two vectors of the same dimensionality with the result being a real number (that is, scalar, that's why this operation is called scalar product). Other names for this operation are dot product and inner product.
Symbolically, the scalar product of two vectors a and b is denoted as
a · b
(with a dot in between, that's why it's called dot product).
The same symbol of operation - dot - is used for multiplication of numbers, numbers and vectors and scalar product of two vectors. Hopefully, the context will be sufficiently clear to differentiate them. At the same time, the rules of these operations are in many ways similar (like the commutative, associative and distributive laws), which makes usage of the same symbol for these different operations justifiable.
Since vectors have a geometric interpretation as a directed segment and an algebraic interpretation as an ordered set of real numbers (a tuple), the scalar product also can be interpreted geometrically and algebraically. Before giving a formal definition of the scalar product using these two interpretations, let's suggest certain reasonable requirements it should satisfy to be rightfully called a "product".
Rule 1 - independence law
Scalar product of two vectors depends only on their lengths and relative position (an angle between their directions). It does not depend on any other object, including a system of coordinates.
Rule 2 - multiplication by a null-vector
a · 0 = 0
Rule 3 - multiplication of a unit vector by itself
1 · 1 = 1
Rule 4 - commutative law
a · b = b · a
Rule 5 - associative with multiplication by a constant law
(K·a) · b = K·(a · b) and
a · (K·b) = K·(a · b)
Rule 6 - distributive law
(a+b) · c = a · c + b · c
The rules presented above seem to be quite natural. Based on these rules, let's derive the algebraic expression of the scalar product in a tuple representation and in geometric terms.
Consider for simplicity a two-dimensional case and two vectors in tuple representation (a1,a2) and (b1,b2). How would their scalar product look like if we want to satisfy all the rules above?
First of all, we can simplify our job by replacing vector (a1,a2) with an expression
Their equality follows from the rules of multiplication of the vector by a constant and addition of vectors presented in the lecture on vector arithmetic.
Similarly, we can represent a vector (b1,b2):
(b1,b2) = b1·(1,0)+b2·(0,1)
Now the scalar product of vectors (a1,a2) and (b1,b2) equals to the scalar product
[a1·(1,0)+a2·(0,1)] · [b1·(1,0)+b2·(0,1)]
Using the commutative, associative and distributive laws, we can open the brackets and get the following expression for our scalar product:
a1·b1·(1,0)·(1,0) + a1·b2·(1,0)·(0,1) + a2·b1·(0,1)·(1,0) + a2·b2·(0,1)·(0,1)
Both scalar products (1,0)·(1,0) and (0,1)·(0,1) are equal to 1 by the above rule about unit vectors multiplied by themselves.
Situation with (1,0)·(0,1) and (0,1)·(1,0) is a little more complicated.
First of all, these two scalar products equal to each other because of the commutative law.
Secondly, one of the rules above states that a scalar product should depend only on the lengths of the vectors participating in it and an angle between them. According to this rule, the scalar product of (1,0) and (0,1) should be the same as a scalar product of (−1,0) and (0,1) since in both cases the lengths are the same and the angle between the participating vectors is the right angle of 90°. On the other hand, the latter scalar product equals to (−1)·(1,0)·(0,1). Therefore, we have an equality:
(1,0)·(0,1) = (−1)·(1,0)·(0,1)
from which follows that (1,0)·(0,1) equals to 0.
Using this, the final algebraic expression of the scalar product of two vectors in tuple form (a1,a2) and (b1,b2) is
(a1,a2) · (b1,b2) = a1·b1 + a2·b2
Similarly, in three dimensional case the formula for a scalar product is:
(a1,a2,a3) · (b1,b2,b3) =
a1·b1 + a2·b2 + a3·b3
Derivation of this expression is based on the representation of a vector (a1,a2,a3) in a form
a1·(1,0,0) + a2·(0,1,0) + a3·(0,0,1),
a vector (b1,b2,b3) in a form
b1·(1,0,0) + b2·(0,1,0) + b3·(0,0,1) and equalities for scalar products
(1,0,0) · (1,0,0) = 1
(0,1,0) · (0,1,0) = 1
(0,0,1) · (0,0,1) = 1
(1,0,0) · (0,1,0) = 0
(1,0,0) · (0,0,1) = 0
(0,1,0) · (0,0,1) = 0
and their commutative equivalents.
Notice that, instead of formal definition of a scalar product as formulas above, we have derived these formulas based on some reasonable assumptions about properties of a scalar product.