Is there a way to obtain solution $x=0$ for the equation $\frac{1}{x}=\infty$ in Mathematica?

I tried Solve, Reduce, FindInstance and with different options, but Mathematica keeps beeping on me that system contains an infinite object or it gives {} as answer, meaning no solution. I tried with Infinity and ComplexInfinity.

Maple gives $x=0$ as solution.

Why is 0 not a solution to $\frac{1}{x}=\infty$ ? Since 1/0 gives ComplexInfinity

Mathematica graphics

Some attempts

eq = 1/x == ComplexInfinity;
Solve[eq, x, Reals, Method -> "Reduce"]
Solve[eq, x]
Reduce[eq, x]
FindInstance[eq, x]
SolveAlways[eq, x]


enter image description here

Is there some deep mathematical reason why $0$ can not be solution to this equation according to Mathematica, and is there some workaround?

  • 3
    $\begingroup$ "Is there some deep mathematical reason why 0 can not be solution to this equation[...]?" 0 doesn't contain any directional information. 1/x with x tending to 0 is infinity if 0 is approached from a positive direction, but what about a negative or imaginary one? $\endgroup$
    – eyorble
    Commented Jun 20, 2021 at 17:15
  • 2
    $\begingroup$ Why not to solve 1/x==a and then go to a limit? $\endgroup$ Commented Jun 20, 2021 at 18:24
  • $\begingroup$ As @AlexeiBoulbitch suggested, Limit[x /. Solve[1/x == a, x][[1]], a -> Infinity] $\endgroup$
    – Bob Hanlon
    Commented Jun 20, 2021 at 18:27
  • $\begingroup$ @AlexeiBoulbitch because I do not know what the equation looks like before hand. This is done in a program, the equation (generated by another part of the program) can be anything and it needs to solve for $x$. It is not an interactive session where one looks at the screen and then decides what to do. $\endgroup$
    – Nasser
    Commented Jun 20, 2021 at 18:48
  • 1
    $\begingroup$ You can also do something less potentially breaking by using a custom-defined infinity instead of 0 as the value at x==0: infinity /: infinity^(-1) = 0; Solve[(x |-> Piecewise[{{1/x, x != 0}, {infinity, x == 0}}])[s] == infinity, s] $\endgroup$
    – thorimur
    Commented Jun 20, 2021 at 21:36

3 Answers 3


It makes sense on the complex projective line. If you can restrict your computations to that domain, there shouldn't be a problem.

eq = 1/x == ComplexInfinity;
Join @@ Map[
  Solve[#, x] &,
  1/$i == 0 /. Solve[eq /. ComplexInfinity -> $i, $i]

(*  {{x -> 0}}  *)

(You can put $i in a Module etc. if you want to turn it into a function.)

  • $\begingroup$ No arithmetic operations are defined on the complex projective space, in particular, on the complex projective line (see Wiki). In complex analysis the complex plane is compactified by adding ComplexInfinity (in WL notation) to continuously extend fractional-linear functions on Union[Complexes,ComplexInfinity], no more and no less (see Encyclopedia of Mathematics). $\endgroup$
    – user64494
    Commented Jun 21, 2021 at 15:35
  • $\begingroup$ I'd like to stress again thar the Riemann sphere is a topological notion, not an algebraic notion. $\endgroup$
    – user64494
    Commented Jun 21, 2021 at 15:44
  • $\begingroup$ It should be "compactified by the addition..." in the above. $\endgroup$
    – user64494
    Commented Jun 21, 2021 at 15:57
  • $\begingroup$ @user64494 I changed the reference. I hope it’s clearer, but the phrase I used (which was never “Riemann sphere”) is still correct. $\endgroup$
    – Michael E2
    Commented Jun 21, 2021 at 16:29
  • 1
    $\begingroup$ @user64494 I repeat: Algebraic geometry has been using rational functions on the projective line/space for over a century. Beyond that, meromorphic functions may be naturally viewed as functions $\Bbb C \rightarrow P^1(\Bbb C)$. See ref. $\endgroup$
    – Michael E2
    Commented Jun 21, 2021 at 19:47

Because both ComplexInfinity \[Element] Complexes and Infinity \[Element] Reals return False, the equation 1/x==\[Infinity] makes no sense in traditional math. Maple developers must master their math knowledge.

  • $\begingroup$ BTW, the definition 1/0==ComplexInfinity contradicts traditional math. $\endgroup$
    – user64494
    Commented Jun 21, 2021 at 5:09
  • $\begingroup$ See Encyclopedia of Mathematics and Wiki to this end. $\endgroup$
    – user64494
    Commented Jun 21, 2021 at 6:39
  • $\begingroup$ “the equation 1/x==Infinity makes no sense in traditional math” — this is just plain wrong, unless by “traditional” you mean school-kid math. Algebraic geometry has been dealing with such equations for something like 150 years. $\endgroup$
    – Michael E2
    Commented Jun 21, 2021 at 16:27

There is a way of doing this

expr := Solve[1/x == ComplexInfinity, x]

(* Solve::infc: The system 1/x==ComplexInfinity contains an infinite object ComplexInfinity. *)
(* Solve[1/x == ComplexInfinity, x] *)

Solve[1/u_ == ComplexInfinity, u_] := {u -> 0}

(* {x -> 0} *)

As a general rule, I would think this is a very unwise thing to do, but as a bodge to fix a particular problem, it might work.


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.