# Triple product formula of vector and its proof (with Python code)

Wutong snow 2021-11-25 09:20:48
triple product formula vector proof

The triple product formula of a vector is an identity that is often used in vector algebra , Its expression is as follows ： a ⃗ × ( b ⃗ × c ⃗ ) = ( a ⃗ ⋅ c ⃗ ) b ⃗ − ( a ⃗ ⋅ b ⃗ ) c ⃗ \vec{a}\times\left(\vec{b}\times\vec{c}\right) = \left(\vec{a}\cdot\vec{c}\right)\vec{b}-\left(\vec{a}\cdot\vec{b}\right)\vec{c}

We can use the following python Code to prove （ Let's change the above expression a little and prove this identity ） a ⃗ × ( b ⃗ × c ⃗ ) − ( a ⃗ ⋅ c ⃗ ) b ⃗ + ( a ⃗ ⋅ b ⃗ ) c ⃗ = 0 \vec{a}\times\left(\vec{b}\times\vec{c}\right) - \left(\vec{a}\cdot\vec{c}\right)\vec{b}+\left(\vec{a}\cdot\vec{b}\right)\vec{c}=0

import sympy as sym
from sympy import sin,cos,diff
x_a,y_a,z_a,x_b,y_b,z_b,x_c,y_c,z_c = sym.symbols('x_a,y_a,z_a,x_b,y_b,z_b,x_c,y_c,z_c')
a = sym.Matrix([x_a,y_a,z_a])
b = sym.Matrix([x_b,y_b,z_b])
c = sym.Matrix([x_c,y_c,z_c])
A = a.cross(b.cross(c))
B = a.dot(c)*b
C = a.dot(b)*c
print(sym.simplify(A-B+C))


The output result is ：

so , This identity holds .
Of course , We can also calculate... Manually , The amount of calculation is a little larger , It takes patience and care .

Using the triple product formula , We can get another interesting identity , namely ：
a ⃗ × ( b ⃗ × c ⃗ ) + b ⃗ × ( c ⃗ × a ⃗ ) + c ⃗ × ( a ⃗ × b ⃗ ) = 0 \vec{a}\times\left(\vec{b}\times\vec{c}\right) + \vec{b}\times\left(\vec{c}\times\vec{a}\right) + \vec{c}\times\left(\vec{a}\times\vec{b}\right) = 0

We can also use python Procedures to prove ：

import sympy as sym
from sympy import sin,cos,diff
x_a,y_a,z_a,x_b,y_b,z_b,x_c,y_c,z_c = sym.symbols('x_a,y_a,z_a,x_b,y_b,z_b,x_c,y_c,z_c')
a = sym.Matrix([x_a,y_a,z_a])
b = sym.Matrix([x_b,y_b,z_b])
c = sym.Matrix([x_c,y_c,z_c])
A = a.cross(b.cross(c))
B = b.cross(c.cross(a))
C = c.cross(a.cross(b))
print(sym.simplify(A+B+C))


The output result is ：

so , This identity holds .
Of course , We can also calculate... Manually , Expand directly by using the triple product formula, and then merge the similar terms .

https://pythonmana.com/2021/11/20211109004946211Q.html