Solving a cubic system of equations I have the following equation system:

$A_1 x + B_1 y + C_1 z + D_1 xy + E_1 xz + F_1 yz + G_1 xyz = M_1$
$A_2 x + B_2 y + C_2 z + D_2 xy + E_2 xz + F_2 yz + G_2 xyz = M_2$
$A_3 x + B_3 y + C_3 z + D_3 xy + E_3 xz + F_3 yz + G_3 xyz = M_3$

$A_1$, $B_1$, ..., $M_1$, $A_2$, $B_2$, ..., $M_2$, $A_3$, $B_3$, ..., $M_3$ are known.

Trying to get $x$ based on $y$ and $z$ from the first equation, then substituting it in the second equation, then getting $y$ based on $z$ and substituting it in the third equasion seems a nightmare. How to solve this equation system?
A general cubic system of three equations in three unknown has at most 27 solutions. This can be proved by reducing it to a 27 degree polynomial equation in one variable and apply Gauss theorem. Finding the polynomial give you full control of the number of solutions. However, there is a problem with this scheme since it the polynomial of such high degree might be numerically unstable. Another method is Newtons Raphsons method which will give you a numerical solution of the problem.
A possible workaround can be the following:


Let's multiply the first equation with with $-G_2$, the second equation with $G_1$, and add them.
Now multiply the second equation with $-G_3$, the third one with
$G_2$, and add them.
Finally multiply the third equation with $-G_1$, and the first one with $G_3$ and add them.


Theoretically we have now tree new equations, but we escaped from the $xyz$ part.

In the same way let's escape from xy, xz, xz. 

We have now a simple equation system with 3 equations and 3 unknowns:

$AA_1x + BB_1y + CC_1z = MM_1$

$AA_2x + BB_2y + CC_2z = MM_2$

$AA_3x + BB_3y + CC_3z = MM_3$

that's easy to solve.

If you think this wouldn't always work please let me know, or if you have a better solution it is welcomed!