expands out tensor-related products in the symbolic tensor expression texpr.

Details and Options

  • TensorExpand expands sums and products by scalars in tensorial arguments.
  • Expressions involving Dot and Cross are expanded by converting products of pairs of Cross subexpressions into linear combinations of Dot products.
  • Symbolic arguments of Cross are assumed to represent vectors of adequate dimensionality.
  • Symbolic arguments of MatrixPower and Inverse are assumed to represent invertible square matrices.


open allclose all

Basic Examples  (2)

Tensor products of linear combinations are not expanded automatically:

Expand the product:

Expand a scalar product of two cross products:

Scope  (3)

Act on expressions containing all kinds of products:

Act on expressions containing both symbolic and explicit objects:

For some operations, additional information needs to be supplied. The Dot product is not commutative in general:

However, if the objects are declared as vectors, then it is commutative:

Options  (1)

Assumptions  (1)

This expression cannot be canonicalized because the rank of a is unknown:

Assume that a is a vector:

Applications  (6)

Linearity expansions:

Vector identities in dimension 3:

Vector identities in dimension 4:

Combination of transpositions:

Powers of matrices. Matrices are assumed invertible:

Declare a, b, c to be three-dimensional vectors:

Then these formulas effectively invert the matrix {a,b,c}:

Possible Issues  (2)

Expansion of pairs of vector products requires consistent dimensions:

With symbolic expressions, the result may be given as 0, representing a 0 vector or tensor:

Compare with:

Neat Examples  (1)

Declare a family of vectors:

For each integer n, there is a tree expression involving n Cross operations for n+1 vectors v0,,vn:

Now systematically convert all possible combinations of cross products into dot products and one cross product:

Wolfram Research (2012), TensorExpand, Wolfram Language function, https://reference.wolfram.com/language/ref/TensorExpand.html.


Wolfram Research (2012), TensorExpand, Wolfram Language function, https://reference.wolfram.com/language/ref/TensorExpand.html.


Wolfram Language. 2012. "TensorExpand." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TensorExpand.html.


Wolfram Language. (2012). TensorExpand. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TensorExpand.html


@misc{reference.wolfram_2024_tensorexpand, author="Wolfram Research", title="{TensorExpand}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/TensorExpand.html}", note=[Accessed: 18-June-2024 ]}


@online{reference.wolfram_2024_tensorexpand, organization={Wolfram Research}, title={TensorExpand}, year={2012}, url={https://reference.wolfram.com/language/ref/TensorExpand.html}, note=[Accessed: 18-June-2024 ]}