1
$\begingroup$

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
$\endgroup$
3
  • $\begingroup$ 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] $\endgroup$ Oct 9, 2023 at 0:47
  • $\begingroup$ 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. $\endgroup$ Oct 9, 2023 at 7:40
  • $\begingroup$ 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. $\endgroup$
    – user64494
    Oct 9, 2023 at 15:15

3 Answers 3

6
$\begingroup$

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

$\endgroup$
3
  • $\begingroup$ Denominators are very simple too... That can not be the reason to fail the computation. There is some bug in their algorithm. $\endgroup$ Oct 8, 2023 at 16:17
  • 1
    $\begingroup$ @azerbajdzan, please note the last bullet point in the documentation for Eliminate: Eliminate works primarily with linear and polynomial equations. $\endgroup$
    – Domen
    Oct 8, 2023 at 16:18
  • $\begingroup$ "primarily" - that explains why they used equations with Sqrt or Sin in documentation of Eliminate. $\endgroup$ Oct 8, 2023 at 19:29
2
$\begingroup$
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 *)
$\endgroup$
3
  • $\begingroup$ 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. $\endgroup$ Oct 8, 2023 at 19:25
  • $\begingroup$ @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 ... $\endgroup$
    – Domen
    Oct 8, 2023 at 20:09
  • $\begingroup$ ... that has not been updated for quite a while. $\endgroup$
    – Domen
    Oct 8, 2023 at 20:10
1
$\begingroup$
$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

enter image description here

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

enter image description here

$\endgroup$
6
  • $\begingroup$ 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. $\endgroup$ Oct 8, 2023 at 15:18
  • $\begingroup$ 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?). $\endgroup$ Oct 8, 2023 at 15:28
  • $\begingroup$ @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. $\endgroup$
    – Bob Hanlon
    Oct 8, 2023 at 19:04
  • $\begingroup$ 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. $\endgroup$ Oct 8, 2023 at 19:13
  • $\begingroup$ Then I recommend that you edit your question to clarify your intent. As currently posed it merely requests the removal of the variable t $\endgroup$
    – Bob Hanlon
    Oct 8, 2023 at 20:20

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.