Menu

#5266 solve(csc(x) = cot(x)) -> [x = 0], but both csc(0) and cot(0) are undefined

None
open
nobody
solve (66)
5
3 days ago
5 days ago
No
(%i1) solve(csc(x) = cot(x));
(%o1) [x = 0]

(%i2) csc(0);
csc: argument 0 isn't in the domain of csc.
-- an error. To debug this try: debugmode(true);

(%i3) cot(0);
cot: argument 0 isn't in the domain of cot.
-- an error. To debug this try: debugmode(true);

Discussion

  • David Scherfgen

    David Scherfgen - 5 days ago

    solve works on a numerator. trig-subst canonicalizes csc(x) to 1/sin(x) and cot(x) to cos(x)/sin(x), then mrat-numer keeps the numerator 1-cos(x) and drops the denominator sin(x). 1-cos(x) really does vanish at x = 0, but the equation does not, because the denominator vanishes there too.

    For an ordinary rational function this does not happen: ratf cancels the common factor first, so solve((x-1)/(x-1)^2, x) is []. It happens for trigonometric equations because the rational package treats sin(x) and cos(x) as unrelated kernels and cannot see that 1-cos(x) and sin(x) share a zero - that identity is sin^2 + cos^2 = 1, which it does not know.

    src/solve.lisp has known about this for decades, in the comment above easy-cases:

    This can introduce spurious roots if one of the factors is an
    expression that can be undefined or infinity for certain values of
    the variable in question. But soon this will be no worry because I
    will add a list of "possible bad roots" to what SOLVE returns.

    Whoever wrote this never made good on his promise, though.

     

    Last edit: David Scherfgen 5 days ago
    • Stavros Macrakis

      This is an interesting one. Although csc(x) and cot(x) are undefined at x=0, csc(x)-cot(x) is 0 by analytic continuation at x=0. Maxima generally ignores isolated singularities like this, for example it simplifies x/x to 1. So it's unclear whether this is a bug.

      BTW, %solve(csc(x)-cot(x),x) => %union([x = 2 %pi %z874])

       

Log in to post a comment.