# How do I solve a system of equations for only one variable quickly?

I have four order-2 polynomial equations in four unknowns. Call the unknowns x1,x2,x3,x4. I want only x1, and am not at all interested in the values of x2,x3,x4.

Obviously Solve[{…,…,…,…}, {x1,x2,x3,x4}] should give the answer and more. But takes a long time of CPU whirring: indeed, it hasn’t finished. Is there a way to tell Solve (or another function) that x2,x3,x4 are not to appear in the solution for x1, but that there is no need to solve for them? If so, please, how?

Indeed, I would much rather that Solve return the coefficients of the polynomial for x1, rather than returning the solution to that (perhaps high-order) polynomial. Can Solve also be instructed to do that?

Thank you.

• Does using Eliminate help speed up the computation? I have the following in mind: Solve[Eliminate[{…,…,…,…}, {x2,x3,x4}],x1]. Perhaps you could give us a working example? – QuantumDot Nov 23 '15 at 23:12
• Can you try GroebnerBasis[{equations}, x1, {x2, x3, x4}]? – J. M. will be back soon Nov 23 '15 at 23:17
• Both answers excellent, the GroebnerBasis being slightly superior as it returns the polynomial rather than requiring solution of a remaining equation. Both shorten the run-time to instantaneous. – jdaw1 Nov 23 '15 at 23:23
• Then, can you answer your own question? – J. M. will be back soon Nov 24 '15 at 2:09
• Well, now I can (thank you), but surely you (J.M.) deserve the points/credit/whatever. – jdaw1 Nov 24 '15 at 9:33

As J.M. posted in a comment, GroebnerBasis[{equations}, x1, {x2, x3, x4}] does exactly what was asked.
But a commendation also goes to QuantumDot’s suggestion of Solve[Eliminate[{…,…,…,…}, {x2,x3,x4}],x1].
• You might get a speed boost with GroebnerBasis[{equations}, x1, {x2, x3, x4}, MonomialOrder->EliminationOrder]. – Daniel Lichtblau Nov 27 '15 at 16:30