Solution (source code)

= Solution

Using the <Levi-Civita symbol> and the <epsilon-delta identity>,
$$
[\mathbf a\times(\mathbf b\times\mathbf c)]_i
=\varepsilon_{ijk}a_j\varepsilon_{klm}b_lc_m
=(\delta_{il}\delta_{jm}-\delta_{im}\delta_{jl})a_jb_lc_m
=b_i(\mathbf a\cdot\mathbf c)-c_i(\mathbf a\cdot\mathbf b).
$$
This proves the <vector triple product identity>
$$
\boxed{\mathbf a\times(\mathbf b\times\mathbf c)
=(\mathbf a\cdot\mathbf c)\mathbf b-(\mathbf a\cdot\mathbf b)\mathbf c}.
$$
Applying it inside the <scalar triple product> gives <Lagrange's identity>
$$
\boxed{(\mathbf a\times\mathbf b)\cdot(\mathbf c\times\mathbf d)
=(\mathbf a\cdot\mathbf c)(\mathbf b\cdot\mathbf d)
-(\mathbf a\cdot\mathbf d)(\mathbf b\cdot\mathbf c)}.
$$