1
$\begingroup$

Why is Mathematica not able to identify that this polynomial:

B1^4 + 2 B1^2 B2^2 + B2^4 + 2 B1^2 B3^2 + 2 B2^2 B3^2 + B3^4 + 
  2 B1^2 E1^2 - 2 B2^2 E1^2 - 2 B3^2 E1^2 + E1^4 + 8 B1 B2 E1 E2 - 
  2 B1^2 E2^2 + 2 B2^2 E2^2 - 2 B3^2 E2^2 + 2 E1^2 E2^2 + E2^4 + 
  8 B1 B3 E1 E3 + 8 B2 B3 E2 E3 - 2 B1^2 E3^2 - 2 B2^2 E3^2 + 
  2 B3^2 E3^2 + 2 E1^2 E3^2 + 2 E2^2 E3^2 + E3^4

has the simple form of

(-B1^2 - B2^2 - B3^2 + E1^2 + E2^2 + E3^2)^2 +4 (B1 E1 + B2 E2 + B3 E3)^2

I have tried quite a few things ub they all give the same or similar results:

FullSimplify[ExpandAll[(-B1^2 - B2^2 - B3^2 + E1^2 + E2^2 + E3^2)^2 + 4 (B1 E1 + B2 E2 + B3 E3)^2]]

But it outputs a garbled result instead >

B1^4 + B2^4 + (-B3^2 + E1^2 + E2^2)^2 + 8 B2 B3 E2 E3 + 
  2 (B3^2 + E1^2 + E2^2) E3^2 + E3^4 + 8 B1 E1 (B2 E2 + B3 E3) + 
  2 B1^2 (B2^2 + B3^2 + E1^2 - E2^2 - E3^2) + 2 B2^2 (B3^2 - E1^2 + E2^2 - E3^2)

Can one use Collect[] to achieve the desired results?


edit challenge:

a^4 + 2 a^2 b^2 + b^4 + 2 a^2 B1^2 - 2 b^2 B1^2 + B1^4 + 2 a^2 B2^2 - 
  2 b^2 B2^2 + 2 B1^2 B2^2 + B2^4 + 2 a^2 B3^2 - 2 b^2 B3^2 + 
  2 B1^2 B3^2 + 2 B2^2 B3^2 + B3^4 - 8 a b B1 E1 - 2 a^2 E1^2 + 
  2 b^2 E1^2 + 2 B1^2 E1^2 - 2 B2^2 E1^2 - 2 B3^2 E1^2 + E1^4 - 
  8 a b B2 E2 + 8 B1 B2 E1 E2 - 2 a^2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B1 V2 X3 - 8 a E1 V2 X3 - 8 B2 E1 X0 X3 + 8 B1 E2 X0 X3 - 
  8 V0 V3 X0 X3 - 8 B1 B3 X1 X3 - 8 E1 E3 X1 X3 + 8 V1 V3 X1 X3 - 
  8 B2 B3 X2 X3 - 8 E2 E3 X2 X3 + 8 V2 V3 X2 X3 + 2 a^2 X3^2 + 
  2 b^2 X3^2 + 2 B1^2 X3^2 + 2 B2^2 X3^2 - 2 B3^2 X3^2 + 2 E1^2 X3^2 + 
  2 E2^2 X3^2 - 2 E3^2 X3^2 + 2 V0^2 X3^2 - 2 V1^2 X3^2 - 
  2 V2^2 X3^2 + 2 V3^2 X3^2 - 2 X0^2 X3^2 + 2 X1^2 X3^2 + 
  2 X2^2 X3^2 + X3^4
$\endgroup$
2
  • $\begingroup$ Having fun with the Maxwell field strength tensor, I see... $\endgroup$ Commented May 27, 2020 at 17:32
  • $\begingroup$ @MichaelSeifert nailed it! $\endgroup$
    – Anon21
    Commented May 27, 2020 at 17:36

1 Answer 1

3
$\begingroup$

If one knows or suspects that a complicated algebraic expression can be written as an unknown combination of a small number of simpler terms, one can use SolveAlways to check this.

In the present case, the physical rationale underlying the situation is investigating relativistic invariants of the electromagnetic field, where it is known that the only two invariants that are quadratic in the electric & magnetic fields are $\vec{E}^2 - \vec{B}^2$ and $\vec{E} \cdot \vec{B}$. Since the given expression is of fourth order in the fields, if it can be written in terms of these quantities, it must be equal to some linear combination of their squares and their product.

foo = B1^4 + 2 B1^2 B2^2 + B2^4 + 2 B1^2 B3^2 + 2 B2^2 B3^2 + B3^4 + 
   2 B1^2 E1^2 - 2 B2^2 E1^2 - 2 B3^2 E1^2 + E1^4 + 8 B1 B2 E1 E2 - 
   2 B1^2 E2^2 + 2 B2^2 E2^2 - 2 B3^2 E2^2 + 2 E1^2 E2^2 + E2^4 + 
   8 B1 B3 E1 E3 + 8 B2 B3 E2 E3 - 2 B1^2 E3^2 - 2 B2^2 E3^2 + 
   2 B3^2 E3^2 + 2 E1^2 E3^2 + 2 E2^2 E3^2 + E3^4;
bar = p (-B1^2 - B2^2 - B3^2 + E1^2 + E2^2 + E3^2)^2 + 
  q (B1 E1 + B2 E2 + B3 E3)^2 + 
  r (-B1^2 - B2^2 - B3^2 + E1^2 + E2^2 + E3^2) (B1 E1 + B2 E2 + 
     B3 E3);
SolveAlways[foo == bar, {B1, B2, B3, E1, E2, E3}]

(* {{p -> 1, q -> 4, r -> 0}} *)

If it was the case that this expression could not be written in terms of this form, then SolveAlways would have returned an empty solution set.

$\endgroup$
3
  • $\begingroup$ Well, ain't you a clever one --- mind trying the one in the edit ;). $\endgroup$
    – Anon21
    Commented May 27, 2020 at 18:11
  • $\begingroup$ Ouch, that's a nasty one. Might be possible if you told me what kind of tensors the quantities a, b, X_i, and V_i are — though the utility of this technique diminishes quickly as the number of invariants grows. $\endgroup$ Commented May 27, 2020 at 18:15
  • $\begingroup$ It is the determinant of the matrix representation of a complete multivector of $Cl_4(\mathbb{C})$ represented with the Dirac matrices. Where $\mathbf{U}=a+X0 \gamma_0+X1\gamma_1+X2\gamma_2+X3\gamma_3+E_1\gamma_{01}+E_2\gamma_{02}+E_3\gamma_{03}+B_1\gamma_{23}+B_2\gamma_{13}+B_3\gamma_{12}+V0\gamma_{123}+V1\gamma_{023}+V2\gamma_{013}+V3\gamma_{012}+b\gamma_{0123}$, then $\det {\mathbf{U}}$. A tought one surely, but on the plus side it doesn't/cannot get tougher (for 4x4 matrices at least). $\endgroup$
    – Anon21
    Commented May 27, 2020 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.