Skip to content

Behaviour of z^Infinity and Infinity^z #24

Open

Description

@harrysarson

What does the Riemann mapping say when it comes to the complex exponential?

@derknorton
@balagge

Activity

  1. changed the title [-]Behaviour of `Complex(Infinity).exp()`?[/-] [+]Behaviour of Complex(Infinity).exp()?[/+] on Mar 9, 2018
  2. derknorton commented on Mar 9, 2018

    @derknorton
    Contributor
  3. harrysarson commented on Mar 9, 2018

    @harrysarson
    ContributorAuthor

    What does that make Complex(Infinity).exp() equal to?

  4. derknorton commented on Mar 9, 2018

    @derknorton
    Contributor
  5. balagge commented on Mar 9, 2018

    @balagge

    indeterminate. (no value, NaN, whatever. same as 0 / 0)

  6. balagge commented on Mar 9, 2018

    @balagge

    wolfram:
    kepernyokep 2018-03-09 17 26 18

  7. balagge commented on Mar 9, 2018

    @balagge

    This is because
    kepernyokep 2018-03-09 17 32 33
    which means that if z = x + iy and z goes to infinity, then we cannot determine the limit of exp(z). For example, take the following z values: 0, i, 2i, 3i, .... Then the limit exp(0), exp(i), exp(2i), ... will be meaningless, as exp(n i) = cos n + i sin n, which is essentially a "random" point on the unit circle, clearly does not converge (neither to infinity, nor to any given complex number)

  8. balagge commented on Mar 9, 2018

    @balagge

    or, if you take the z values: 0, i*pi, 2 i*pi, 3 i*pi, etc. (clearly z goes to infinity) then the exp(z) values will be +1, -1, +1, ... as exp(n i pi) is -1 if n is odd and + 1 if n is even.
    complex exponentiation is always tricky.

  9. balagge commented on Mar 9, 2018

    @balagge

    truly confusing, I never liked this part of complex theory.
    https://en.wikipedia.org/wiki/Exponential_function#Complex_plane

  10. balagge commented on Mar 9, 2018

    @balagge

    this is how wikipedia pictures the complex exp function. pretty cool. Brightness means the absolute value, color means the direction.

    Now if you approach infinity "to the right", then you will have a sequence that also goes to infinity. However, if you approach it "to the top" (as in the example I wrote above), then you will be going around the unit circle. Same with the bottom direction.

    If you go left (to the same complex infinity) than the exponentiation will go to zero...

    https://upload.wikimedia.org/wikipedia/commons/a/a7/Complex_exp.jpg

  11. derknorton commented on Mar 9, 2018

    @derknorton
    Contributor
  12. harrysarson commented on Mar 9, 2018

    @harrysarson
    ContributorAuthor

    @derknorton Both cases are relivant but to clarify:

    Complex(Infinity).exp() calculates e^Infinity so I was talking about the second case.

  13. derknorton commented on Mar 9, 2018

    @derknorton
    Contributor
  14. harrysarson commented on Mar 9, 2018

    @harrysarson
    ContributorAuthor

    To summarise for complex z :

    1. 0 ^ Infinity === 0
    2. 1 ^ Infinity === 1
    3. z ^ Infinity === |z| < 1 ? 0 : NaN
    4. Infinity ^ Infinity === NaN
    5. Infinity ^ 0 === NaN
    6. Infinity ^ 1 === Infinity
    7. Infinity ^ z === Infinity

    maybe?

  15. derknorton commented on Mar 9, 2018

    @derknorton
    Contributor
  16. 4 remaining items

  17. balagge commented on Mar 9, 2018

    @balagge
    1. 1 ^ Infinity is indeterminate. This I do not understand as of yet. Still working on it.
  18. balagge commented on Mar 9, 2018

    @balagge
    1. z ^ Infinity is indeterminate, even if |z| < 1. This would require determining a definite limit for z ^ w (where w -> Infinity). However, unless z is a positive real number, such powers are difficult to calculate and some (most) do not even have a single well-defined value, but many different (sometimes infinitely many different) possible results. As I have said before, exponentiation on the complex plane is hard and counter-intuitive.

    Quote from wikipedia:

    "Trying to extend these functions to the general case of noninteger powers of complex numbers that are not positive reals leads to difficulties. Either we define discontinuous functions or multivalued functions. Neither of these options is entirely satisfactory."

    In other words, z ^ w is better left undefined, unless z is a positive real.

    This means that the infinite case, z ^ Infinity should, in my opinion, be indeterminate for the general case (z is not a positive real).

    However, for the positive real case: this is also indeterminate, unless z = 1, which is the case above, and I am not sure about it. This case is basically very similar to e ^ Infinity, because a power a ^ w can be solved by writing a ^ w = e ^ (ln(a) w ). Then decompose w = x + i y, you get e ^ (ln(a) * (x + i y)), which is e ^ (ln(a) x + i ln(a) y) = a ^ x * (cos (ln(a) y) + i sin (ln(a) y). This is a bit of a mess at first sight, but it is essentially the same as the natural base case mentioned earlier, unless a = 1. For a <> 1, you can always choose some silly w's, so that e.g. the real part of w (which is x) is fixed, and then you get "random" numbers on the circle with radius a^x, clearly divergent.

  19. balagge commented on Mar 9, 2018

    @balagge
    1. Infinity ^ Infinity === NaN that is correct.
    2. Infinity ^ 0 === NaN
    3. Infinity ^ 1 === Infinity that is correct by definition.
    4. Infinity ^ z is, unfortunately, again indeterminate, unless z is a non-zero real number. However, for reals, this may have a value: Infinity ^ x is Infinity, if x is positive, 0 if x is negative. I am a bit tired to be 100% sure, but this is what Wolfram gives as a result and it seems ok.
  20. balagge commented on Mar 9, 2018

    @balagge

    Summary:

    Any exponentiation involving Infinity (either as base or exponent) is indeterminate, except:

    (6) Infinity ^ 1 === Infinity,
    (7a) Infinity ^ z === Infinity, if z is a positive real number (Im(z) === 0, Re(z) >0)
    (7b) Infinity ^ z === 0, if z is a negative real number (Im(z) === 0, Re(z) < 0)

    And, the only question is the result of 1 ^ Infinity, but I need some more time on that one. (but wolfram gives indeterminate for that as well)

  21. harrysarson commented on Mar 14, 2018

    @harrysarson
    ContributorAuthor

    For (7b) could we qnot have Infinity ^ z === 0 if the real part of z is negative. Wolfram agrees:
    image.

    I can buy that (1), (3) and (4) should all be NaN.

    As for 1 ^ Infinity, could this not be 1? The best argument that I can think of against this is that it is z ^ Infinity is NaN for all z !== 1 so it might as well be NaN for 1 aswell.

  22. changed the title [-]Behaviour of Complex(Infinity).exp()?[/-] [+]Behaviour of z^Infinity and Infinity^z[/+] on Mar 14, 2018
  23. harrysarson commented on Mar 14, 2018

    @harrysarson
    ContributorAuthor

    To summarise for any complex z:

    1. z ^ Infinity === NaN
    2. Infinity ^ z === Infinity if Im(z) === 0 and Re(z) > 0
    3. Infinity ^ z === 0 if Re(z) < 0
    4. Infinity ^ 0 === 1
    5. Infinity ^ z === NaN otherwise

    Question: should Infinity ^ 0 === 1 which would fit with behavour for Numbers in js?

  24. derknorton commented on Mar 15, 2018

    @derknorton
    Contributor
  25. harrysarson commented on Mar 15, 2018

    @harrysarson
    ContributorAuthor

    image

  26. balagge commented on Mar 21, 2018

    @balagge

    @harrysarson

    For (7b) could we qnot have Infinity ^ z === 0 if the real part of z is negative.

    you are right, provided that exponentiation is otherwise defined with a fixed branch cut of the log() function.

    Wikipedia has a good explanation on how to compute a complex power:

    https://en.wikipedia.org/wiki/Exponentiation#Computing_complex_powers

    So if we want to compute w^z, we must choose a branch cut of log(), normally (-pi, pi]

    Then w must be written in polar decomposition w = r e^(i theta) (choosing theta so that pi < theta <= pi, the principal branch cut), and z in Cartesian decomposition z = c + d i). The following formula gives the result:

    w^z = r^c e^(-d theta) (cos(d log(r) + c theta) + i sin (d log(r) + c theta))

    This indeed converges if Re(z) = c < 0 (w -> Infinity) , because the r^c part will converge to 0, the e^(-d theta) part is within a fixed range (here we use heavily that theta is in a fixed finite interval), and the rest is just a point on the unit circle, again bounded.

    Generally, with multi-valued powers, this does not work, because theta can have any value and might "work against" the r^c part, hence no convergence.

    Bottom line: if Complex.js defines z^w using this approach of a fixed branch cut, then Infinity^z = 0 if Re(z) < 0. You are right, I was wrong. :)

  27. balagge commented on Mar 21, 2018

    @balagge

    For Infinity ^ 0 all material that I can find says it is indeterminate (even with real infinity)

    https://en.wikipedia.org/wiki/Indeterminate_form

    Infinity ^ 0 cannot be computed with lim z^0 (z -> Infinity). (That approach would yield Infinity * 0 = 0 as well, clearly wrong, az Infinity * 0 is also indeterminate)

    The right way is with lim z^w (z -> Infinity, w -> 0). And that does not converge generally.

  28. balagge commented on Mar 21, 2018

    @balagge

    Funny that javascript has Math.pow(Infinity,0) === 1. Yeah, that is a problem. But javascript also has Math.pow(-2, Infinity) === Infinity, which is even more silly. I do not know where they got that idea ...

  29. gwhitney commented on Oct 31, 2026

    @gwhitney

    It's not 100% clear to me whether this conversation finally settled on the desired behaviors for all cases of exponentiation involving infinities, but to close out the related issues in mathjs it would be very helpful if these could be nailed down.

    Also, not to throw a wrench into these works, but it seems to me that these functions need to deal with three different infinities:

    A) The JavaScript number Infinity, which I think of as "real positive infinity," or in the context of the complex numbers, "infinity in the direction 1+0i." Further, I would propose that the guiding principle for determining what the desired value for some operation f(c, Infinity) should be is that it should equal the limit as real x approaches ∞ of f(c, x), if that exists, or NaN otherwise.
    B) The JavaScript number -Infinity, which should be the same but in the other direction, presumably governed by f(c,-Infinity) equal to the limit as real x approaches -∞ of f(c,x) if that exists, or NaN otherwise.
    C) The Complex entity Complex.INFINITY, which I gather from the discussions is taken to represent "infinity in any direction" or more precisely the point opposite 0 on the Riemann sphere. This is to be governed by arithmetic on the Riemann sphere, which (I think...) corresponds to f(c, Complex.INFINITY) should be the common limit as z grows in modulus without bound along any path, if such limits are all alike, and NaN otherwise. In practice, this rule means that many operations on Complex.INFINITY will be undefined (many more than on Infinity and -Infinity) because such limits can be very dependent on the particular path chosen.

    The reason I think this is important is encapsulated by the example pow(-0.5, Infinity). Evaluated on the real numbers with javascript numbers or in mathjs with javascript numbers, this is Math.pow(-0.5, Infinity) = math.pow(-0.5, Infinity) = 0. Therefore, for Complex.js to be conservative for reals as javascript numbers embedded in the complex numbers, it should be the case that complex(-0.5, 0).pow(Infinity) equals 0, but it currently does not; it comes out as Complex.NAN. Since indeed, even for complex z = -0.5 + 0i, it is the case that for real x the limit as x goes to ∞ is 0, I think the current behavior is incorrect; I believe complex(-0.5, 0).pow(Infinity) should be 0, and complex(-0.5, 0).pow(Complex.INFINITY) should be Complex.NAN (since the limit certainly does not exist if the exponent is allowed to increase unboundedly in modulus along any path).

    It would be really lovely to clear these issues off the mathjs and complex.js tables once and for all in a logically consistent manner, since they have been so long-standing. Any effort/attention the maintainers here can give the matter would be greatly appreciated, and I am happy to assist in any way I can -- please just ask.

  30. donhatch commented on Nov 4, 2026

    @donhatch

    @gwhitney wrote:

    The reason I think this is important is encapsulated by the example pow(-0.5, Infinity). Evaluated on the real numbers with javascript numbers or in mathjs with javascript numbers, this is Math.pow(-0.5, Infinity) = math.pow(-0.5, Infinity) = 0. Therefore, for Complex.js to be conservative for reals as javascript numbers embedded in the complex numbers, it should be the case that complex(-0.5, 0).pow(Infinity) equals 0, but it currently does not; it comes out as Complex.NAN. Since indeed, even for complex z = -0.5 + 0i, it is the case that for real x the limit as x goes to ∞ is 0, I think the current behavior is incorrect; I believe complex(-0.5, 0).pow(Infinity) should be 0, and complex(-0.5, 0).pow(Complex.INFINITY) should be Complex.NAN (since the limit certainly does not exist if the exponent is allowed to increase unboundedly in modulus along any path).

    Perhaps an even simpler more dramatic example: pow(0.5, Infinity). If I understand correctly, that will now return Complex.NAN rather than 0, which seems rather shocking.

    If I understand correctly, @gwhitney 's proposal is that Complex(0.5,0).pow(Infinity) should return 0, and Complex(0.5,0).pow(Complex.INFINITY) should return Complex.NAN. That sounds sensible to me.

    (More generally, w^+-Infinity should be the familiar limit restricting the exponent's limit path to reals, which is well-defined for most w's; that is: w^Infinity=0 and w^-Infinity=Infinity for |w|<1, w^Infinity=Infinity and w^-Infinity=0 for |w|>1, 1^+-Infinity=1, w^+-Infinity=Complex.NAN for all other |w|=1. Hopefully I typed all that correctly.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions