Menu ▾ ▴

#5700 rectform of coth and cot divides by zero at their zeros

None
closed
nobody
5
10 hours ago
10 hours ago
No

By Claude:

rectform signals an error for coth(log(%i)), whose value is 0, since log(%i) is %i*%pi/2:

(%i1) display2d : false$
(%i2) rectform(log(%i));
(%o2) (%i*%pi)/2
(%i3) rectform(coth(log(%i)));
expt: undefined: 0 to a negative exponent.
(%i4) float(coth(log(%i)));
(%o4) -6.123233995736766e-17*%i

realpart, imagpart, sign, cabs, carg, polarform and is(equal(coth(log(%i)), 0)) signal the same error, and so does rectform(cot(-%i*log(%i))), which simplifies to %i*coth(log(%i)).

The general results for coth and cot are undefined at the zeros of these functions, so substituting a zero signals the same error, although the value there is 0:

(%i5) rectform(coth(x + %i*y));
(%o5) sinh(2*x)/((cos(2*y)+cosh(2*x))*(sin(2*y)^2/(cos(2*y)+cosh(2*x))^2
                                      +sinh(2*x)^2/(cos(2*y)+cosh(2*x))^2))
 -(%i*sin(2*y))/((cos(2*y)+cosh(2*x))*(sin(2*y)^2/(cos(2*y)+cosh(2*x))^2
                                      +sinh(2*x)^2/(cos(2*y)+cosh(2*x))^2))
(%i6) subst([x = 0, y = %pi/2], %);
expt: undefined: 0 to a negative exponent.
(%i7) rectform(cot(x + %i*y));
(%o7) sin(2*x)/((cosh(2*y)+cos(2*x))*(sinh(2*y)^2/(cosh(2*y)+cos(2*x))^2
                                     +sin(2*x)^2/(cosh(2*y)+cos(2*x))^2))
 -(%i*sinh(2*y))/((cosh(2*y)+cos(2*x))*(sinh(2*y)^2/(cosh(2*y)+cos(2*x))^2
                                       +sin(2*x)^2/(cosh(2*y)+cos(2*x))^2))
(%i8) subst([x = %pi/2, y = 0], %);
expt: undefined: 0 to a negative exponent.

Discussion

  • David Scherfgen

    David Scherfgen - 10 hours ago
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -31,3 +31,4 @@
                                            +sin(2*x)^2/(cosh(2*y)+cos(2*x))^2))
     (%i8) subst([x = %pi/2, y = 0], %);
     expt: undefined: 0 to a negative exponent.
    +```
    
     
  • David Scherfgen

    David Scherfgen - 10 hours ago
    • status: open --> closed
     
  • David Scherfgen

    David Scherfgen - 10 hours ago

    Fixed by commit [6b6dac].

     

    Related

    Commit: [6b6dac]


Log in to post a comment.