# Vector algebra relations

The following are important identities in vector algebra. Identities that only involve the magnitude of a vector $\|\mathbf {A} \|$ and the dot product (scalar product) of two vectors A·B, apply to vectors in any dimension, while identities that use the cross product (vector product) A×B only apply in three dimensions, since the cross product is only defined there. Most of these relations can be dated to founder of vector calculus Josiah Willard Gibbs, if not earlier.

## Magnitudes

The magnitude of a vector A can be expressed using the dot product:
    $\|\mathbf {A} \|^{2}=\mathbf {A\cdot A}$
In three-dimensional Euclidean space, the magnitude of a vector is determined from its three components using Pythagoras' theorem:
    $\|\mathbf {A} \|^{2}=A_{1}^{2}+A_{2}^{2}+A_{3}^{2}$

## Inequalities

* The Cauchy–Schwarz inequality: $\mathbf {A} \cdot \mathbf {B} \leq \left\|\mathbf {A} \right\|\left\|\mathbf {B} \right\|$
* The triangle inequality: $\|\mathbf {A+B} \|\leq \|\mathbf {A} \|+\|\mathbf {B} \|$
* The reverse triangle inequality: $\|\mathbf {A-B} \|\geq {\Bigl |}\|\mathbf {A} \|-\|\mathbf {B} \|{\Bigr |}$

## Angles

The vector product and the scalar product of two vectors define the angle between them, say θ:
    $\sin \theta ={\frac {\|\mathbf {A} \times \mathbf {B} \|}{\left\|\mathbf {A} \right\|\left\|\mathbf {B} \right\|}}\quad (-\pi <\theta \leq \pi )$
To satisfy the right-hand rule, for positive θ, vector B is counter-clockwise from A, and for negative θ it is clockwise.
    $\cos \theta ={\frac {\mathbf {A} \cdot \mathbf {B} }{\left\|\mathbf {A} \right\|\left\|\mathbf {B} \right\|}}\quad (-\pi <\theta \leq \pi )$
The Pythagorean trigonometric identity then provides:
    $\left\|\mathbf {A\times B} \right\|^{2}+(\mathbf {A} \cdot \mathbf {B} )^{2}=\left\|\mathbf {A} \right\|^{2}\left\|\mathbf {B} \right\|^{2}$
If a vector A = (A$_x$, A$_y$, A$_z$) makes angles α, β, γ with an orthogonal set of x-, y- and z-axes, then:
    $\cos \alpha ={\frac {A_{x}}{\sqrt {A_{x}^{2}+A_{y}^{2}+A_{z}^{2}}}}={\frac {A_{x}}{\|\mathbf {A} \|}}\ ,$
and analogously for angles β, γ. Consequently:
    $\mathbf {A} =\left\|\mathbf {A} \right\|\left(\cos \alpha \ {\hat {\mathbf {i} }}+\cos \beta \ {\hat {\mathbf {j} }}+\cos \gamma \ {\hat {\mathbf {k} }}\right),$
with ${\hat {\mathbf {i} }},\ {\hat {\mathbf {j} }},\ {\hat {\mathbf {k} }}$ unit vectors along the axis directions.

## Areas and volumes

The area Σ of a parallelogram with sides A and B containing the angle θ is:
    $\Sigma =AB\sin \theta ,$
which will be recognized as the magnitude of the vector cross product of the vectors A and B lying along the sides of the parallelogram. That is:
    $\Sigma =\left\|\mathbf {A} \times \mathbf {B} \right\|={\sqrt {\left\|\mathbf {A} \right\|^{2}\left\|\mathbf {B} \right\|^{2}-\left(\mathbf {A} \cdot \mathbf {B} \right)^{2}}}\ .$
(If A, B are two-dimensional vectors, this is equal to the determinant of the 2 × 2 matrix with rows A, B.) The square of this expression is:
    $\Sigma ^{2}=(\mathbf {A\cdot A} )(\mathbf {B\cdot B} )-(\mathbf {A\cdot B} )(\mathbf {B\cdot A} )=\Gamma (\mathbf {A} ,\ \mathbf {B} )\ ,$
where Γ(A, B) is the Gram determinant of A and B defined by:
    $\Gamma (\mathbf {A} ,\ \mathbf {B} )={\begin{vmatrix}\mathbf {A\cdot A} &\mathbf {A\cdot B} \\\mathbf {B\cdot A} &\mathbf {B\cdot B} \end{vmatrix}}\ .$
In a similar fashion, the squared volume V of a parallelepiped spanned by the three vectors A, B, C is given by the Gram determinant of the three vectors:
    $V^{2}=\Gamma (\mathbf {A} ,\ \mathbf {B} ,\ \mathbf {C} )={\begin{vmatrix}\mathbf {A\cdot A} &\mathbf {A\cdot B} &\mathbf {A\cdot C} \\\mathbf {B\cdot A} &\mathbf {B\cdot B} &\mathbf {B\cdot C} \\\mathbf {C\cdot A} &\mathbf {C\cdot B} &\mathbf {C\cdot C} \end{vmatrix}}\ ,$
Since A, B, C are three-dimensional vectors, this is equal to the square of the scalar triple product $\det[\mathbf {A} ,\mathbf {B} ,\mathbf {C} ]=|\mathbf {A} ,\mathbf {B} ,\mathbf {C} |$ below.
This process can be extended to n-dimensions.

## Addition and multiplication of vectors

* Commutativity of addition: $\mathbf {A} +\mathbf {B} =\mathbf {B} +\mathbf {A}$.
* Commutativity of scalar product: $\mathbf {A} \cdot \mathbf {B} =\mathbf {B} \cdot \mathbf {A}$.
* Anticommutativity of cross product: $\mathbf {A} \times \mathbf {B} =\mathbf {-} (\mathbf {B} \times \mathbf {A} )$.
* Distributivity of multiplication by a scalar over addition: $c(\mathbf {A} +\mathbf {B} )=c\mathbf {A} +c\mathbf {B}$.
* Distributivity of scalar product over addition: $\left(\mathbf {A} +\mathbf {B} \right)\cdot \mathbf {C} =\mathbf {A} \cdot \mathbf {C} +\mathbf {B} \cdot \mathbf {C}$.
* Distributivity of vector product over addition: $(\mathbf {A} +\mathbf {B} )\times \mathbf {C} =\mathbf {A} \times \mathbf {C} +\mathbf {B} \times \mathbf {C}$.
* Scalar triple product: $\mathbf {A} \cdot (\mathbf {B} \times \mathbf {C} )=\mathbf {B} \cdot (\mathbf {C} \times \mathbf {A} )=\mathbf {C} \cdot (\mathbf {A} \times \mathbf {B} )=|\mathbf {A} \,\mathbf {B} \,\mathbf {C} |={\begin{vmatrix}A_{x}&B_{x}&C_{x}\\A_{y}&B_{y}&C_{y}\\A_{z}&B_{z}&C_{z}\end{vmatrix}}.$
* Vector triple product: $\mathbf {A} \times (\mathbf {B} \times \mathbf {C} )=(\mathbf {A} \cdot \mathbf {C} )\mathbf {B} -(\mathbf {A} \cdot \mathbf {B} )\mathbf {C}$.
* Jacobi identity: $\mathbf {A} \times (\mathbf {B} \times \mathbf {C} )+\mathbf {C} \times (\mathbf {A} \times \mathbf {B} )+\mathbf {B} \times (\mathbf {C} \times \mathbf {A} )=\mathbf {0} .$
* Lagrange's identity: $|\mathbf {A} \times \mathbf {B} |^{2}=(\mathbf {A} \cdot \mathbf {A} )(\mathbf {B} \cdot \mathbf {B} )-(\mathbf {A} \cdot \mathbf {B} )^{2}$.

### Quadruple product

In mathematics, the quadruple product is a product of four vectors in three-dimensional Euclidean space. The name "quadruple product" is used for two different products, the scalar-valued scalar quadruple product and the vector-valued vector quadruple product or vector product of four vectors.

#### Scalar quadruple product

The scalar quadruple product is defined as the dot product of two cross products:
    $(\mathbf {a\times b} )\cdot (\mathbf {c} \times \mathbf {d} )\ ,$
where a, b, c, d are vectors in three-dimensional Euclidean space. It can be evaluated using the Binet-Cauchy identity:
    $(\mathbf {a\times b} )\cdot (\mathbf {c} \times \mathbf {d} )=(\mathbf {a\cdot c} )(\mathbf {b\cdot d} )-(\mathbf {a\cdot d} )(\mathbf {b\cdot c} )\ .$
or using the determinant:
    $(\mathbf {a\times b} )\cdot (\mathbf {c} \times \mathbf {d} )={\begin{vmatrix}\mathbf {a\cdot c} &\mathbf {a\cdot d} \\\mathbf {b\cdot c} &\mathbf {b\cdot d} \end{vmatrix}}\ .$

#### Vector quadruple product

The vector quadruple product is defined as the cross product of two cross products:
    $(\mathbf {a\times b} )\mathbf {\times } (\mathbf {c} \times \mathbf {d} )\ ,$
where a, b, c, d are vectors in three-dimensional Euclidean space. It can be evaluated using the identity:
    $(\mathbf {a\times b} )\mathbf {\times } (\mathbf {c} \times \mathbf {d} )=[\mathbf {a,\ b,\ d} ]\mathbf {c} -[\mathbf {a,\ b,\ c} ]\mathbf {d} \ ,$
using the notation for the triple product:
    $[\mathbf {a,\ b,\ c} ]=\mathbf {a} \cdot (\mathbf {b} \times \mathbf {c} )\ .$
Equivalent forms can be obtained using the identity:
    $[\mathbf {b,\ c,\ d} ]\mathbf {a} -[\mathbf {c,\ d,\ a} ]\mathbf {b} +[\mathbf {d,\ a,\ b} ]\mathbf {c} -[\mathbf {a,\ b,\ c} ]\mathbf {d} =0\ .$
This identity can also be written using tensor notation and the Einstein summation convention as follows:
    $(\mathbf {a\times b} )\mathbf {\times } (\mathbf {c} \times \mathbf {d} )=\varepsilon _{ijk}a^{i}c^{j}d^{k}b^{l}-\varepsilon _{ijk}b^{i}c^{j}d^{k}a^{l}=\varepsilon _{ijk}a^{i}b^{j}d^{k}c^{l}-\varepsilon _{ijk}a^{i}b^{j}c^{k}d^{l}$
where ε$_{ijk}$ is the Levi-Civita symbol.
Related relationships:
* A consequence of the previous equation: $|\mathbf {A} \,\mathbf {B} \,\mathbf {C} |\,\mathbf {D} =(\mathbf {A} \cdot \mathbf {D} )\left(\mathbf {B} \times \mathbf {C} \right)+\left(\mathbf {B} \cdot \mathbf {D} \right)\left(\mathbf {C} \times \mathbf {A} \right)+\left(\mathbf {C} \cdot \mathbf {D} \right)\left(\mathbf {A} \times \mathbf {B} \right).$
* In 3 dimensions, a vector D can be expressed in terms of basis vectors {A,B,C} as:$\mathbf {D} \ =\ {\frac {\mathbf {D} \cdot (\mathbf {B} \times \mathbf {C} )}{|\mathbf {A} \,\mathbf {B} \,\mathbf {C} |}}\ \mathbf {A} +{\frac {\mathbf {D} \cdot (\mathbf {C} \times \mathbf {A} )}{|\mathbf {A} \,\mathbf {B} \,\mathbf {C} |}}\ \mathbf {B} +{\frac {\mathbf {D} \cdot (\mathbf {A} \times \mathbf {B} )}{|\mathbf {A} \,\mathbf {B} \,\mathbf {C} |}}\ \mathbf {C} .$

## Applications

These relations are useful for deriving various formulas in spherical and Euclidean geometry. For example, if four points are chosen on the unit sphere, A, B, C, D, and unit vectors drawn from the center of the sphere to the four points, a, b, c, d respectively, the identity:
    $(\mathbf {a\times b} )\mathbf {\cdot } (\mathbf {c\times d} )=(\mathbf {a\cdot c} )(\mathbf {b\cdot d} )-(\mathbf {a\cdot d} )(\mathbf {b\cdot c} )\ ,$
in conjunction with the relation for the magnitude of the cross product:
    $\|\mathbf {a\times b} \|=ab\sin \theta _{ab}\ ,$
and the dot product:
    $\mathbf {a\cdot b} =ab\cos \theta _{ab}\ ,$
where a = b = 1 for the unit sphere, results in the identity among the angles attributed to Gauss:
    $\sin \theta _{ab}\sin \theta _{cd}\cos x=\cos \theta _{ac}\cos \theta _{bd}-\cos \theta _{ad}\cos \theta _{bc}\ ,$
where x is the angle between a × b and c × d, or equivalently, between the planes defined by these vectors.