# Lagrange's identity

{{#invoke:Hatnote|hatnote}}

In algebra, Lagrange's identity, named after Joseph Louis Lagrange, is:

{\begin{aligned}{\biggl (}\sum _{k=1}^{n}a_{k}^{2}{\biggr )}{\biggl (}\sum _{k=1}^{n}b_{k}^{2}{\biggr )}-{\biggl (}\sum _{k=1}^{n}a_{k}b_{k}{\biggr )}^{2}&=\sum _{i=1}^{n-1}\sum _{j=i+1}^{n}(a_{i}b_{j}-a_{j}b_{i})^{2}\\&{\biggl (}={\frac {1}{2}}\sum _{i=1}^{n}\sum _{j=1,j\neq i}^{n}(a_{i}b_{j}-a_{j}b_{i})^{2}{\biggr )},\end{aligned}} which applies to any two sets {a1, a2, . . ., an} and {b1, b2, . . ., bn} of real or complex numbers (or more generally, elements of a commutative ring). This identity is a generalisation of the Brahmagupta-Fibonacci identity and a special form of the Binet–Cauchy identity.

In a more compact vector notation, Lagrange's identity is expressed as:

$\|{\mathbf {a} }\|^{2}\ \|{\mathbf {b} }\|^{2}-({\mathbf {a\cdot b} })^{2}=\sum _{1\leq i where a and b are n-dimensional vectors with components that are real numbers. The extension to complex numbers requires the interpretation of the dot product as an inner product or Hermitian dot product. Explicitly, for complex numbers, Lagrange's identity can be written in the form:

${\biggl (}\sum _{k=1}^{n}|a_{k}|^{2}{\biggr )}{\biggl (}\sum _{k=1}^{n}|b_{k}|^{2}{\biggr )}-{\biggl |}\sum _{k=1}^{n}a_{k}b_{k}{\biggr |}^{2}=\sum _{i=1}^{n-1}\sum _{j=i+1}^{n}|a_{i}{\overline {b}}_{j}-a_{j}{\overline {b}}_{i}|^{2}$ involving the absolute value.

Since the right-hand side of the identity is clearly non-negative, it implies Cauchy's inequality in the finite-dimensional real coordinate spacen and its complex counterpart ℂn.

Geometrically, the identity asserts that the square of the volume of the parallelepiped spanned by a set of vectors is the Gram determinant of the vectors.

## Lagrange's identity and exterior algebra

In terms of the wedge product, Lagrange's identity can be written

$(a\cdot a)(b\cdot b)-(a\cdot b)^{2}=(a\wedge b)\cdot (a\wedge b).$ Hence, it can be seen as a formula which gives the length of the wedge product of two vectors, which is the area of the parallelogram they define, in terms of the dot products of the two vectors, as

$\|a\wedge b\|={\sqrt {(\|a\|\ \|b\|)^{2}-\|a\cdot b\|^{2}}}.$ ## Lagrange's identity and vector calculus

In three dimensions, Lagrange's identity asserts that if a and b are vectors in ℝ3 with lengths |a| and |b|, then Lagrange's identity can be written in terms of the cross product and dot product:

$|{\mathbf {a} }|^{2}|{\mathbf {b} }|^{2}-({\mathbf {a\cdot b} })^{2}=|{\mathbf {a\times b} }|^{2}$ Using the definition of angle based upon the dot product (see also Cauchy–Schwarz inequality), the left-hand side is

$|{\mathbf {a} }|^{2}|{\mathbf {b} }|^{2}(1-\cos ^{2}\theta )=|{\mathbf {a} }|^{2}|{\mathbf {b} }|^{2}\sin ^{2}\theta$ where θ is the angle formed by the vectors a and b. The area of a parallelogram with sides |a| and |b| and angle θ is known in elementary geometry to be

$|{\mathbf {a} }|\,|{\mathbf {b} }|\,|\sin \theta |,$ so the left-hand side of Lagrange's identity is the squared area of the parallelogram. The cross product appearing on the right-hand side is defined by

${\mathbf {a} }\times {\mathbf {b} }=(a_{2}b_{3}-a_{3}b_{2}){\mathbf {i} }+(a_{3}b_{1}-a_{1}b_{3}){\mathbf {j} }+(a_{1}b_{2}-a_{2}b_{1}){\mathbf {k} }$ which is a vector whose components are equal in magnitude to the areas of the projections of the parallelogram onto the yz, zx, and xy planes, respectively.

### Seven dimensions

{{#invoke:main|main}} For a and b as vectors in ℝ7, Lagrange's identity takes on the same form as in the case of ℝ3 

$|{\mathbf {a} }|^{2}|{\mathbf {b} }|^{2}-|{\mathbf {a} }\cdot {\mathbf {b} }|^{2}=|{\mathbf {a} }\times {\mathbf {b} }|^{2}\ ,$ However, the cross product in 7 dimensions does not share all the properties of the cross product in 3 dimensions. For example, the direction of a × b in 7-dimensions may be the same as c × d even though c and d are linearly independent of a and b. Also the seven-dimensional cross product is not compatible with the Jacobi identity.

### Quaternions

A quaternion p is defined as the sum of a scalar t and a vector v:

$p=t+{\mathbf {v} }=t+x\ {\mathbf {i} }+y\ {\mathbf {j} }+z\ {\mathbf {k} }.$ The product of two quaternions p = t + v and q = s + w is defined by

$pq=(st-{\mathbf {v} }\cdot {\mathbf {w} })+s\ {\mathbf {v} }+t\ {\mathbf {w} }+{\mathbf {v} }\times {\mathbf {w} }.$ The quaternionic conjugate of q is defined by

${\overline {q}}=t-{\mathbf {v} },$ and the norm squared is

$|q|^{2}=q{\overline {q}}=t^{2}\ +\ x^{2}+\ y^{2}\ +\ z^{2}.$ The multiplicativity of the norm in the quaternion algebra provides, for quaternions p and q:

$|pq|=|p||q|.\,$ The quaternions p and q are called imaginary if their scalar part is zero; equivalently, if

$p={\mathbf {v} },\quad q={\mathbf {w} }.$ Lagrange's identity is just the multiplicativity of the norm of imaginary quaternions,

$|{\mathbf {v} }{\mathbf {w} }|^{2}=|{\mathbf {v} }|^{2}|{\mathbf {w} }|^{2},\,$ since, by definition,

$|{\mathbf {v} }{\mathbf {w} }|^{2}=({\mathbf {v} }\cdot {\mathbf {w} })^{2}+|{\mathbf {v} }\times {\mathbf {w} }|^{2}.$ ## Proof of algebraic form

The vector form follows from the Binet-Cauchy identity by setting ci = ai and di = bi. The second version follows by letting ci and di denote the complex conjugates of ai and bi, respectively,

Here is also a direct proof. The expansion of the first term on the left side is:

(1)   $\left(\sum _{k=1}^{n}a_{k}^{2}\right)\left(\sum _{k=1}^{n}b_{k}^{2}\right)=\sum _{i=1}^{n}\sum _{j=1}^{n}a_{i}^{2}b_{j}^{2}=\sum _{k=1}^{n}a_{k}^{2}b_{k}^{2}+\sum _{i=1}^{n-1}\sum _{j=i+1}^{n}a_{i}^{2}b_{j}^{2}+\sum _{j=1}^{n-1}\sum _{i=j+1}^{n}a_{i}^{2}b_{j}^{2}\ ,$ which means that the product of a column of as and a row of bs yields (a sum of elements of) a square of abs, which can be broken up into a diagonal and a pair of triangles on either side of the diagonal.

The second term on the left side of Lagrange's identity can be expanded as:

(2)   $\left(\sum _{k=1}^{n}a_{k}b_{k}\right)^{2}=\sum _{k=1}^{n}a_{k}^{2}b_{k}^{2}+2\sum _{i=1}^{n-1}\sum _{j=i+1}^{n}a_{i}b_{i}a_{j}b_{j}\ ,$ which means that a symmetric square can be broken up into its diagonal and a pair of equal triangles on either side of the diagonal.

To expand the summation on the right side of Lagrange's identity, first expand the square within the summation:

$\sum _{i=1}^{n-1}\sum _{j=i+1}^{n}(a_{i}b_{j}-a_{j}b_{i})^{2}=\sum _{i=1}^{n-1}\sum _{j=i+1}^{n}(a_{i}^{2}b_{j}^{2}+a_{j}^{2}b_{i}^{2}-2a_{i}b_{j}a_{j}b_{i}).$ Distribute the summation on the right side,

$\sum _{i=1}^{n-1}\sum _{j=i+1}^{n}(a_{i}b_{j}-a_{j}b_{i})^{2}=\sum _{i=1}^{n-1}\sum _{j=i+1}^{n}a_{i}^{2}b_{j}^{2}+\sum _{i=1}^{n-1}\sum _{j=i+1}^{n}a_{j}^{2}b_{i}^{2}-2\sum _{i=1}^{n-1}\sum _{j=i+1}^{n}a_{i}b_{j}a_{j}b_{i}.$ Now exchange the indices i and j of the second term on the right side, and permute the b factors of the third term, yielding:

(3)   $\sum _{i=1}^{n-1}\sum _{j=i+1}^{n}(a_{i}b_{j}-a_{j}b_{i})^{2}=\sum _{i=1}^{n-1}\sum _{j=i+1}^{n}a_{i}^{2}b_{j}^{2}+\sum _{j=1}^{n-1}\sum _{i=j+1}^{n}a_{i}^{2}b_{j}^{2}-2\sum _{i=1}^{n-1}\sum _{j=i+1}^{n}a_{i}b_{i}a_{j}b_{j}\ .$ Back to the left side of Lagrange's identity: it has two terms, given in expanded form by Equations (Template:EquationNote) and (Template:EquationNote). The first term on the right side of Equation (Template:EquationNote) ends up canceling out the first term on the right side of Equation (Template:EquationNote), yielding

(Template:EquationNote) - (Template:EquationNote) = $\sum _{i=1}^{n-1}\sum _{j=i+1}^{n}a_{i}^{2}b_{j}^{2}+\sum _{j=1}^{n-1}\sum _{i=j+1}^{n}a_{i}^{2}b_{j}^{2}-2\sum _{i=1}^{n-1}\sum _{j=i+1}^{n}a_{i}b_{i}a_{j}b_{j}$ which is the same as Equation (Template:EquationNote), so Lagrange's identity is indeed an identity, Q.E.D..

## Proof of Lagrange's identity for complex numbers

Normed division algebras require that the norm of the product is equal to the product of the norms. Lagrange's identity exhibits this equality. The product identity used as a starting point here, is a consequence of the norm of the product equality with the product of the norm for scator algebras. This proposal, originally presented in the context of a deformed Lorentz metric, is based on a transformation stemming from the product operation and magnitude definition in hyperbolic scator algebra. Lagrange's identity can be proved in a variety of ways. Most derivations use the identity as a starting point and prove in one way or another that the equality is true. In the present approach, Lagrange's identity is actually derived without assuming it a priori. An extended version of these results are available in an open source journal.

Let $a_{i},b_{i}\in {\mathbb {C} }$ be complex numbers and the overbar represents complex conjugate.

The product identity $\prod _{i=1}^{n}\left(1-a_{i}{\bar {a}}_{i}-b_{i}{\bar {b}}_{i}+a_{i}{\bar {a}}_{i}b_{i}{\bar {b}}_{i}\right)=\prod _{i=1}^{n}\left(1-a_{i}{\bar {a}}_{i}\right)\prod _{i=1}^{n}\left(1-b_{i}{\bar {b}}_{i}\right)$ reduces to the complex Lagrange's identity when fourth order terms, in a series expansion, are considered.

In order to prove it, expand the product on the LHS of the product identity in terms of series up to fourth order. To this end, recall that products of the form $\left(1+x_{i}\right)$ can be expanded in terms of sums as $\prod _{i=1}^{n}\left(1+x_{i}\right)=1+\sum _{i=1}^{n}x_{i}+\sum _{i where ${\mathcal {O}}^{3+}(x)$ means terms with order three or higher in $x$ .

$\prod _{i=1}^{n}\left(1-a_{i}{\bar {a}}_{i}-b_{i}{\bar {b}}_{i}+a_{i}{\bar {a}}_{i}b_{i}{\bar {b}}_{i}\right)=1-\sum _{i=1}^{n}\left(a_{i}{\bar {a}}_{i}+b_{i}{\bar {b}}_{i}\right)+\sum _{i=1}^{n}a_{i}{\bar {a}}_{i}b_{i}{\bar {b}}_{i}+\sum _{i The product of this expression up to fourth order is

$\prod _{i=1}^{n}\left(1-a_{i}{\bar {a}}_{i}\right)\prod _{i=1}^{n}\left(1-b_{i}{\bar {b}}_{i}\right)=1-\sum _{i=1}^{n}\left(a_{i}{\bar {a}}_{i}+b_{i}{\bar {b}}_{i}\right)+\left(\sum _{i=1}^{n}a_{i}{\bar {a}}_{i}\right)\left(\sum _{i=1}^{n}b_{i}{\bar {b}}_{i}\right)+\sum _{i Substitution of these two results in the product identity give

$\sum _{i=1}^{n}a_{i}{\bar {a}}_{i}b_{i}{\bar {b}}_{i}+\sum _{i The product of two conjugates series can be expressed as series involving the product of conjugate terms. The conjugate series product is $\left(\sum _{i=1}^{n}x_{i}\right)\left(\sum _{i=1}^{n}{\bar {x}}_{i}\right)=\sum _{i=1}^{n}x_{i}{\bar {x}}_{i}+\sum _{i , thus

The terms of the last two series on the LHS are grouped as $a_{i}{\bar {a}}_{i}b_{j}{\bar {b}}_{j}+a_{j}{\bar {a}}_{j}b_{i}{\bar {b}}_{i}-a_{i}b_{i}{\bar {a}}_{j}{\bar {b}}_{j}-{\bar {a}}_{i}{\bar {b}}_{i}a_{j}b_{j}=\left(a_{i}{\bar {b}}_{j}-a_{j}{\bar {b}}_{i}\right)\left({\bar {a}}_{i}b_{j}-{\bar {a}}_{j}b_{i}\right),$ in order to obtain the complex Lagrange's identity:

$\left(\sum _{i=1}^{n}a_{i}b_{i}\right)\left(\sum _{i=1}^{n}{\overline {a_{i}b_{i}}}\right)+\sum _{i In terms of the modulii,

$\left|\sum _{i=1}^{n}a_{i}b_{i}\right|^{2}+\sum _{i Lagrange's identity for complex numbers has been obtained from a straightforward product identity. A derivation for the reals is obviously even more succinct. Since the Cauchy–Schwarz inequality is a particular case of Lagrange's identity, this proof is yet another way to obtain the CS inequality. Higher order terms in the series produce novel identities.