# Is it possible to simplify expression in vector expression?

Assume input as follows

in=w = {a, b, c}; v = {d, e, g};
jMatrix = {{J1, 0, 0}, {0, J2, 0}, {0, 0, J3}};
ans= 1/2*jMatrix.Cross[v, w] + 1/2*(Cross[v, jMatrix.w] + Cross[w,jMatrix.v]) + jMatrix.Cross[w, v];


we have output

out={-(1/2) (c e - b g) (j1 + j2 + j3), 1/2 (c d - a g) (j1 + j2 + j3), -(1/2) (b d - a e) (j1 + j2 + j3)}

Can i simplify the out to vector crossproduct or dotproduct form(in other words, more concise form.)?

ans1 // Simplify seems don't work.

Thanks @Carl Woll, TensorReduce works well, but it failed when i set jMatrix as $I_3$.

Clear["Global*"]
ans1 = 1/2*jMatrix.Cross[v, w] +
1/2*(Cross[v, jMatrix.w] + Cross[w, jMatrix.v]) +
jMatrix.Cross[w, v];
TensorReduce[ans1,
Assumptions -> (v | w) \[Element] Vectors &&
jMatrix \[Element] IdentityMatrix]//TeXForm


the result output not concise.

• If mma can specify the form, and then to find the coefficient, if expression don't match the hypothetical form, only add some residual part.... – Ben Dec 19 '17 at 19:30

If you avoid using explicit vectors and matrices, you could use TensorReduce. Here is your expression:

ans=1/2*jMatrix.Cross[v,w]+1/2*(Cross[v,jMatrix.w]+Cross[w,jMatrix.v])+jMatrix.Cross[w,v];
ans //TeXForm


$\frac{1}{2} (v\times (\operatorname{jMatrix}.w)+w\times (\operatorname{jMatrix}.v))+\frac{\operatorname{jMatrix}.v\times w}{2}+\operatorname{jMatrix}.w\times v$

And here is the result of TensorReduce:

TensorReduce[
ans,
Assumptions -> (v|w) ∈ Vectors && jMatrix ∈ Matrices[{3,3}]
] //TeXForm


$\frac{1}{2} v\times (\operatorname{jMatrix}.w)+\frac{1}{2} w\times (\operatorname{jMatrix}.v)-\frac{\operatorname{jMatrix}.v\times w}{2}$

Slightly simpler than your original expression.

The OP asked about setting jMatrix to IdentityMatrix. For this you could use my TensorSimplify paclet. Install the paclet with:

PacletInstall[
"TensorSimplify",
"Site" -> "http://raw.githubusercontent.com/carlwoll/TensorSimplify/master"
]


Once installed, you can load the package with:

<<TensorSimplify


Then, the following does the simplification you want:

$Assumptions = (v|w) ∈ Vectors; TensorSimplify[ans1 /. jMatrix -> Inactive[IdentityMatrix]] //TeXForm $\frac{w\times v}{2}$• Let me try, if i find some technology, i will update this question, thank you for your patience.@Carl Woll – Ben Dec 19 '17 at 19:35 • Amazing! thank you again@Carl Woll – Ben Dec 19 '17 at 19:42 • good job! @Carl Woll – Ben Dec 20 '17 at 1:48 Also ClearAll[w, v, jMatrix] Inactivate[1/2 jMatrix . Cross[v, w] + 1/2 (Cross[v, jMatrix . w] + Cross[w, jMatrix . v]) + jMatrix . Cross[w, v], Cross|Dot] $\frac {1} {2} (v\times (\text {jMatrix}.w) + w \times (\text {jMatrix}.v)) + \frac {\text {jMatrix}.v\times w} {2} + \text {jMatrix}.w\times v\$

• it can works, thank you! @kglr – Ben Dec 20 '17 at 1:49
• @Ben, my pleasure. – kglr Dec 20 '17 at 1:53