The Wolfram Mathematica notebook which contains the code that produces all the Mathematica output in this web page may be downloaded at this link.
We denote by 𝔽 one of the following four fields: ℤ, a set of integers, ℚ, a set of rational numbers, ℝ, a set of real numbers, and ℂ, a set of complex numbers. However, norm definition involves only two of them, either ℝ or ℂ.
This section is devoted to one of the most important operations in all of linear algebra---dot product. Many operations and algorithms involve dot product, including convolution, correlation, matrix multiplication, duality, the Fourier transform, signal filtering, and many others.
Dot Product
We met many times in previous sections a special linear combination of numerical vectors. For instance, a linear equation in n unknownsRemark 1: Although textbooks on linear algebra define dot product for vectors of the same vector space (mostly because it leads to fruitfully theory and geometric applications), our definition extends dot product for vectors from different vector spaces, but of the same dimension and over the same field 𝔽 of scalars. Importance of this definition stems from practical applications; for instance, in calculus you learn that the line integral involves definition of the dot product for vector field F with infinitesimal dr:
Remark 2: In applications, numerical vectors are usually associated with measurements and so inherit units. For instance, integer 5 is associated with 5 millions of dollars in Wall street offices, the same number is considered as a 5 dollars bill by a bank's clerk, but mechanical engineer may look at it as 5 centimeters, and computer science folks consider this information as 5 GB. Only mathematicians see in 5 an integer or number without any unit. Therefore, vectors and scalars in Linear Algebra are not related to any specific unit measurements. Now we all appreciate the buity of mathematical language because we enter our particular information into a computer---this device recognizes only electric pulses as on or off---there is no room for any unit. When Joseph Fourier (1768--1830) introduced the Fourier transform in 1822
If v represents a displacement (e.g., in meters) and f represents a force (e.g., in Newtons), then f • v represents work (in Newton-meters or Joules). Therefore, the force has units of "Joules per meter".
If v represents a velocity (e.g., in meters per second) and φ represents momentum (e.g., in kgm/s), then φ(v) = m • v represents kinetic energy (in kg²/s² or Joules). Therefore, the dual vector (momentum) has units of "kg*m/s". ■
Remark 3: Recall that two vector spaces V and U are isomorphic (denoted V ≌ U) if there is a bijective linear map between them. This bijection (which is one-to-one and onto mapping) can be achieved by considering ordered bases α = [ a₁, a₂, … , an ] and β = [ b₁, b₂, … , bn ] in these vector spaces V and U, respectively. Then components of every vector with respect to a chosen ordered basis can be identified uniquely with an n-tuple. Therefore, the algebraic formula \eqref{EqDot.2} is essentially applied to two isomorphic copies of the Cartesian product 𝔽n. Geometric interpretation of the dot product, which is coordinate independent and therefore conveys invariant properties of these products, is given in the Euclidean space section. Then scalar product can be defined as a bilinear form:
Note: The definition of the dot product does not restrict of applying it to two distinct isomorphic versions of the Cartesian product 𝔽n. So you can find the dot product of a row vector with a column vector. However, we try to avoid writing it as matrix multiplication,
Mathematica does not distinguish rows from columns. Dot product can be accomplished with two Mathematica commands:
Dot[a, b]
a . b

One of the main and fruitfull applications of the dot product is observed when scalar product involves numerical vectors from 𝔽n or their isomorphic copies. Upon introducing an ordered basis α = [e₁, e₂, … , en] in a finite dimensional vector space V, every its vector v = c₁e₁ + c₂e₂ + ⋯ + cnen is uniqwuely identified with the corresponding coordinate vector ⟦v⟧α = (c₁, c₂, … , cn) ∈ 𝔽n.
Solution: Using the component formula (1) for the dot product of three-dimensional vectors \[ \mathbf{a} \bullet \mathbf{b} = a_1 b_1 + a_2 b_2 + a_3 b_3 , \] we calculate the dot product to be \[ \mathbf{a} \bullet \mathbf{b} = 3 \cdot 4 - 2 \cdot 5 + 1 \cdot 2 = \]
Dot[a, b]
Not every curvilinear system of coordinates supports dot product, as the following example shows.
Properties of dot product
The following basic properties of the dot product are valid for vectors from the same vector space. They are all easily proven from the above definition. In the following properties, u, v, u, and w are n-dimensional vectors, and λ is a number (scalar):
- u • v = v • u (commutative law);
- (u + v) • w = u • w + v • w (distributive law);
- (λ u) • v = λ (u • v) ;
-
for any two column vectors u, v, and a square matrix A, the following equation holds:
u • Av = ATu • v, where AT is the transpose of a square matrix A.
- Applying the definition of dot product to u · v and v · u, we obtain \begin{align*} \mathbf{u} \bullet \mathbf{v} &= u_1 v_1 + u_2 v_2 + \cdots + u_n v_n \\ \mathbf{v} \bullet \mathbf{u} &= v_1 u_1 + v_2 u_2 + \cdots + v_n u_n \end{align*} Since product of two numbers from field 𝔽 is commutative, we conclude thatu · v = v · u.
- Since every finite dimensional vector space is isomorphic to 𝔽n, we can assume that these vectors u, v, and w belong to the Cartesian product 𝔽n. Then \[ \mathbf{u} + \mathbf{v} = \left( u_1 , \ldoys , u_n \right) + \left( v_1 , \ldots , v_n \right) = \left( u_1 + v_1 , \ldots , u_n + v_n \right) . \] Taking the dot product with w, we get \[ \left( \mathbf{u} + \mathbf{v} \right) u_1 w_1 + v_1 w_1 + \cdots u_n w_n + v_n w_n = \mathbf{u} \bulle \mathbf{w} + \mathbf{v} \bulle \mathbf{w} . \]
(u • v)² ≤ (u • u) · (v • v)
Now suppose that neither u nor v is zero. It follows that ∥u∥ > 0 and ∥v∥ > 0 because the dot product x • x > 0 for any nonzero vector x. We have \begin{align*} 0 &\le \left( \frac{{\bf u}}{\| {\bf u} \|} + \frac{{\bf v}}{\| {\bf v} \|} \right) \bullet \left( \frac{{\bf u}}{\| {\bf u} \|} + \frac{{\bf v}}{\| {\bf v} \|} \right) \\ &= \left( \frac{{\bf u}}{\| {\bf u} \|} \bullet \frac{{\bf u}}{\| {\bf u} \|} \right) + 2 \left( \frac{{\bf u}}{\| {\bf u} \|} \bullet \frac{{\bf v}}{\| {\bf v} \|} \right) + \left( \frac{{\bf v}}{\| {\bf v} \|} \bullet \frac{{\bf v}}{\| {\bf v} \|} \right) \\ &= \frac{1}{\| {\bf u} \|^2} \left( {\bf u} \bullet {\bf u} \right) + \frac{2}{\| {\bf u} \| \cdot \| {\bf v} \|} \left( {\bf u} \bullet {\bf v} \right) + \frac{1}{\| {\bf v} \|^2} \left( {\bf v} \bullet {\bf v} \right) \\ &= \frac{1}{\| {\bf u} \|^2} \, \| {\bf u} \|^2 + 2 \left( \frac{{\bf u}}{\| {\bf u} \|} \bullet \frac{{\bf v}}{\| {\bf v} \|} \right) + \frac{1}{\| {\bf v} \|^2} \, \| {\bf v} \|^2 \\ &= 1 + 2 \left( \frac{{\bf u}}{\| {\bf u} \|} \bullet \frac{{\bf v}}{\| {\bf v} \|} \right) + 1 \end{align*} Hence, −∥u∥ · ∥v∥ ≤ u • v. Similarly, \begin{align*} 0 &\le \left( \frac{{\bf u}}{\| {\bf u} \|} - \frac{{\bf v}}{\| {\bf v} \|} \right) \bullet \left( \frac{{\bf u}}{\| {\bf u} \|} - \frac{{\bf v}}{\| {\bf v} \|} \right) \\ &= \left( \frac{{\bf u}}{\| {\bf u} \|} \bullet \frac{{\bf u}}{\| {\bf u} \|} \right) - 2 \left( \frac{{\bf u}}{\| {\bf u} \|} \bullet \frac{{\bf v}}{\| {\bf v} \|} \right) + \left( \frac{{\bf v}}{\| {\bf v} \|} \bullet \frac{{\bf v}}{\| {\bf v} \|} \right) \\ &= \frac{1}{\| {\bf u} \|^2} \left( {\bf u} \bullet {\bf u} \right) - \frac{2}{\| {\bf u} \| \cdot \| {\bf v} \|} \left( {\bf u} \bullet {\bf v} \right) + \frac{1}{\| {\bf v} \|^2} \left( {\bf v} \bullet {\bf v} \right) \\ &= \frac{1}{\| {\bf u} \|^2} \, \| {\bf u} \|^2 - 2 \left( \frac{{\bf u}}{\| {\bf u} \|} \bullet \frac{{\bf v}}{\| {\bf v} \|} \right) + \frac{1}{\| {\bf v} \|^2} \, \| {\bf v} \|^2 \\ &= 1 - 2 \left( \frac{{\bf u}}{\| {\bf u} \|} \bullet \frac{{\bf v}}{\| {\bf v} \|} \right) + 1 \end{align*} Therefore, u • v ≤ ∥u∥ · ∥v∥. By combining the two inequalities, we obtain the Cauchy inequality.
Note: The inequality in part (4) was first proved by the French mathematician, engineer, and physicist baron Augustin-Louis Cauchy in 1821. In 1859, Viktor Bunyakovsky extended this inequality to its integral version (that is, for the case where we have continuous summation). 30 years later, in 1888, Hermann Schwarz established the general form of this inequality, valid in vector spaces endowed with dot product. Therefore, this inequality is usually referred to as Cauchy–Schwarz inequality, also Cauchy–Bunyakovsky–Schwarz inequality, or simply CBS-inequality.
![]() |
![]() |
![]() |
||
---|---|---|---|---|
Augustin-Louis Cauchy | Viktor Yakovlevich Bunyakovsky | Hermann Amandus Schwarz |
Duality
In physics, dual vectors appear in various contexts, such as in describing fields (like electromagnetic fields) and in quantum mechanics (using bra-ket notation). ■
At the beginning of twentieth century, it was discovered that the dot product is needed for definition of dual spaces (see section in Part3). Although definition of dot product is symmetrical, it is convenient to separate vectors identifying one of them as a vector, called contravariant vector or ket-vector. When ordered basis in a finite dimensional vector space is chosen, [e₁, e₂, … , en], every vector can be uniqely expressed as linear conbination of the basis vectors:
Using the dual basis [e¹, e², … , en], a vector from the dual space can be written as
In geometry, to distinguish these two partners in Eq.\eqref{EqDot.2}, the vector y is called contravariant vector, and the covector x is referred to as covariant vector. In order to decide between these partners who is who, it is common to use superscript for coordinates of contravariant vector, y = [ y¹, y², y³], and subscript for covariant vectors, x = [x₁, x₂, x₃]. In physics, covariant vectors are also called bra-vectors, while contravariant vectors are known as ket-vectors.
It is customary to omit the sum symbol in this definition and simply write
Dot Product and Linear Transformations
Metric via Dot Product
A vector space, by definition, has no metric inside it, which is very desirable property. It turns out that the scalar product can be used to define length or distance between vectors transferring ℝn into a metric space, known as the Euclidean space. Upon introducing the norm (meaning length or magnitude) of a vector, \( \displaystyle \quad \| {\bf v} \| = +\sqrt{{\bf v} \bullet {\bf v}} , \quad \) the Cauchy inequality can be written as
Geometric Properties of the Dot Product
Many years before Gibbs definition, ancient Greeks discovered that geometrically the product of the corresponding entries of the two sequences of numbers is equivalent to the product of their magnitudes and the cosine of the angle between them. This leads to introducing a metric (or length or distance) in the Cartesian product ℝ³ transferring it into the Euclidean space. Originally, it was the three-dimensional physical space, but in modern mathematics there are Euclidean spaces of any positive integer dimension n, which are called Euclidean n-spaces.
Geometrical analysis yields further interesting properties of the dot product operation that can then be used in nongeometric applications. If we rewrite the Cauchy inequality as an equality with parameter k:
Dot product in coordinate systems
The concepts of angle and radius were already used by ancient Greek astronomer and astrologer Hipparchus (190–120 BC). Although, Grégoire de Saint-Vincent and Bonaventura Cavalieri independently introduced the system's concepts in the mid-17th century, though the actual term polar coordinates has been attributed to Gregorio Fontana in the 18th century.
The polar coordinate system specifies a given point P(x, y) in a plane by using a distance r and an angle θ as its two coordinates (r, θ), where r is the point's distance from a reference point called the pole, and θ is the point's direction from the pole relative to the direction of the abscissa. The distance r from the pole is called the radial coordinate, radial distance or simply radius, and the angle θ is called the angular coordinate, polar angle, or azimuth.
The polar coordinates r and θ can be converted to the Cartesian coordinates x and y by using the trigonometric functions sine and cosine or complex numbers:
The polar coordinate system is extended to three dimensions in two ways: the cylindrical coordinate system adds a second distance coordinate, and the spherical coordinate system adds a second angular coordinate.
When ρ₁, θ₁, ϕ₁ and ρ₂, θ₂, ϕ₂ are known for two vectors u and v, we have
Applications
Scalar products are intimately associated with a variety of physical concepts. For example, the work done by a force applied at a point is defined as the product of the displacement and the component of the force in the direction of displacement (i.e., the projection of the force onto the direction of the displacement). Thus the component of the force perpendicular to the displacement "does no work." If F is the force and s is the displacement, then the work W is by definition equal toThe dot product is very important in physics. Let us consider an example. In classical mechanics, it is true that the ‘work’ that is done when an object is moved equals the dot product of the force acting on the object and the displacement vector:
Naturally, other physical quantities can be expressed in such a way. For example, the electrostatic potential energy gained by moving a charge q along a path C in an electric field E is −q∫C E • dr. We may also note that Ampere's law concerning the magnetic field B associated with a current-carrying wire can be written as \[ \oint_C {\bf B} \bull {\text d}{bf r} = \mu_0 I , \] where I is the current enclosed by a closed path C traversed in a right-handed sense with respect to the current direction. ■
It is not always guaranteed that one can use such special coordinate systems (polar coordinates are an example in which the local orthonormal basis of vectors is not the coordinate basis). However, the dot product between a vector x and a covector y is invariant under all transformations because this product defines a functional generated by covector y. Then the given dot product is just one representation of this linear functional in particular coordinates. Making linear transformation with matrix A, we get
We can use the dot product to find the angle between two vectors. From the definition of the dot product, we get
The prime example of dot operation is work that is defined as the scalar product of force and displacement. The presence of cos(θ) ensures the requirement that the work done by a force perpendicular to the displacement is zero.
The dot product is clearly commutative, 𝑎 · b = b · 𝑎. Moreover, it distributes over vector addition
One can use the distributive property of the dot product to show that if (ax, ay, az) and (bx, by, bz) represent the components of a and b along the axes x, y, and z, then
The dot product of any two vectors of the same dimension can be done with the dot operation given as Dot[vector 1, vector 2] or with use of a period “. “ .
Applications in Physics
- What is the angle between the vectors i + j and i + 3j?
- What is the area of the quadrilateral with vertices at (1, 1), (4, 2), (3, 7) and (2, 3)?
- Aldaz, J. M.; Barza, S.; Fujii, M.; Moslehian, M. S. (2015), "Advances in Operator Cauchy—Schwarz inequalities and their reverses", Annals of Functional Analysis, 6 (3): 275–295, doi:10.15352/afa/06-3-20
- Bunyakovsky, Viktor (1859), "Sur quelques inequalities concernant les intégrales aux différences finies" (PDF), Mem. Acad. Sci. St. Petersbourg, 7 (1): 6
- Cauchy, A.-L. (1821), "Sur les formules qui résultent de l'emploie du signe et sur > ou <, et sur les moyennes entre plusieurs quantités", Cours d'Analyse, 1er Partie: Analyse Algébrique 1821; OEuvres Ser.2 III 373-377
- Deay, T. and Manogue, C.A., he Geometry of the Dot and Cross Products, Journal of Online Mathematics and Its Applications 6.
- Gibbs, J.W. and Wilson, E.B., Vector Analysis: A Text-Book for the Use of Students of Mathematics & Physics: Founded Upon the Lectures of J. W. Gibbs, Nabu Press, 2010.
- Schwarz, H. A. (1888), "Über ein Flächen kleinsten Flächeninhalts betreffendes Problem der Variationsrechnung" (PDF), Acta Societatis Scientiarum Fennicae, XV: 318, archived (PDF) from the original on 2022-10-09
- Solomentsev, E. D. (2001) [1994], "Cauchy inequality", Encyclopedia of Mathematics, EMS Press
- Vector addition