# Eliminating one variable from two simple polynomial equations

Is this really that hard to eliminate variable t? It runs forever without any result.

$$x=-\frac{t (2 t+1)}{4 t^5+1},u=-\frac{2 t}{t^2+1}$$

Eliminate[{x == -((t (1 + 2 t))/(1 + 4 t^5)), u == -((2 t)/(1 + t^2))}, t]


Manually I got in few seconds this result (maybe it is not complete):

-4 u^4 + 5 u^5 + 64 u x - 64 u^2 x - 56 u^3 x + 46 u^4 x + 4 u^5 x - 128 x^2 + 160 u^2 x^2 - 40 u^4 x^2 + 17 u^5 x^2 == 0

• Why aren't you using GroebnerBasis[] to begin with? GroebnerBasis[{x == -((t (1 + 2 t))/(1 + 4 t^5)), u == -((2 t)/(1 + t^2))}, {x, y}, t] Oct 9, 2023 at 0:47
• Yes I can do several other things too. But from the name of the function Eliminate it is clear why I used it. It is even stranger that GroebnerBasis works in this case because it is meant to work on polynomials. The input is not in the polynomial form and more it is in the form of equations. It should be the other way around. Eliminate should manage to solve equations not GroebnerBasis. Oct 9, 2023 at 7:40
• Just to compare. The command of Maple 2018 eliminate({u = -2*t/(t^2+1), x = -t*(1+2*t)/(4*t^5+1)}, t) results in {t = -u*(u^3*x-2*u^3-16*u^2*x+32*x)/(4*u^4*x+u^4-4*u^3-48*u^2*x+64*x)}, {17*u^5*x^2+4*u^5*x-40*u^4*x^2+5*u^5+46*u^4*x-4*u^4-56*u^3*x+160*u^2*x^2-64*u^2*x+64*u*x-128*x^2} in a moment. Oct 9, 2023 at 15:15

Since you want an implicit equation in x and u... get rid of the denominators

Eliminate[{x(1+4t^5)==-t(1+2t),u(1+t^2)==-2t},t]


which INSTANTLY returns

-4*u^4 + 5*u^5 + 64*u*x - 64*u^2*x - 56*u^3*x + 46*u^4*x + 4*u^5*x -
128*x^2 + 160*u^2*x^2 - 40*u^4*x^2 + 17*u^5*x^2 == 0


which is EXACTLY the result you got by hand, so I assume your manual method also eliminated the denominators, without deeply considering consequences.

If I look at the denominators then it looks like those can be zero when t== -1/2 or t==0 and neither of those seem, after a few seconds of thought, to be a problem for your solution.

General rule that widely applies: Denominators hard, make denominators go away

• Denominators are very simple too... That can not be the reason to fail the computation. There is some bug in their algorithm. Oct 8, 2023 at 16:17
• @azerbajdzan, please note the last bullet point in the documentation for Eliminate: Eliminate works primarily with linear and polynomial equations. Oct 8, 2023 at 16:18
• "primarily" - that explains why they used equations with Sqrt or Sin in documentation of Eliminate. Oct 8, 2023 at 19:29
Eliminate[{u == -((2 t)/(1 + t^2)), x == -((t (1 + 2 t))/(1 + 4 t^5))},
t, Mode -> Modular]
(* -4 u^4 + 5 u^5 + 64 u x - 64 u^2 x - 56 u^3 x + 46 u^4 x + 4 u^5 x -
128 x^2 + 160 u^2 x^2 - 40 u^4 x^2 + 17 u^5 x^2 == 0 *)

• There is no sense in using Mode -> Modular if you are not trying to find a solution over some modulus - which I was not. The solution should be found without it. Oct 8, 2023 at 19:25
• @azerbajdzan, you cannot claim that there is "a bug" and that "it is really embarrassing for Mathematica" if you are expecting functions to work differently than explained in the documentation. However, I certainly agree that you could bring this to thea attention of WRI, because it is clear that Eliminate can solve your problem, albeit with a somehow unexpected option Modulus. They may have an explanation, update the documentation, or feel that they can make the function work without this. However, note that Eliminate is quite an old function ... Oct 8, 2023 at 20:09
• ... that has not been updated for quite a while. Oct 8, 2023 at 20:10
\$Version

(* "13.3.1 for Mac OS X ARM (64-bit) (July 24, 2023)" *)

Clear["Global*"]

Reduce[
{x == -((t (1 + 2 t))/(1 + 4 t^5)), u == -((2 t)/(1 + t^2))},
x, {t}] // Simplify


Reduce[
{x == -((t (1 + 2 t))/(1 + 4 t^5)), u == -((2 t)/(1 + t^2))},
x, {t}, Reals] // Simplify


• Where is the answer? You should get the polynomial you can see in my question. I am not interested in solving for x. I need implicit equation in x and u. Oct 8, 2023 at 15:18
• Seeing your answer I guess Eliminate did not work even in the latest version of Mathematica. But that is really embarrassing for Mathematica. Such a simple task... and if I am not mistaken they claimed huge speed increase in polynomial manipulation and eliminating of variables in version 13 (or was it version 11?). Oct 8, 2023 at 15:28
• @azerbajdzan - x == f[u] is an implicit equation for x and u. Plotting these implicit equations would include @Domen solution as well as some additional curve elements. Oct 8, 2023 at 19:04
• The question is about finding implicit polynomial equation in x and u - i.e. finding f(x,u)==0 where function f is polynomial or ratio of two polynomials. Oct 8, 2023 at 19:13
• Then I recommend that you edit your question to clarify your intent. As currently posed it merely requests the removal of the variable t` Oct 8, 2023 at 20:20