Menu

#4810 risch(sqrt(sin(x)^2-1),x) = 0

None
closed
nobody
risch (21)
5
2026-07-19
2026-07-07
No

Obviously wrong:

(%i1) risch(sqrt(sin(x)^2-1),x);
(%o1) 0

Discussion

  • David Scherfgen

    David Scherfgen - 2026-07-07

    The problem is that trigin1 strips the imaginary part because it assumes that it contains only "garbage" that would simplify to zero. It should actually never do that.

     
  • David Scherfgen

    David Scherfgen - 2026-07-19
    • status: open --> closed
     
  • David Scherfgen

    David Scherfgen - 2026-07-19

    Fixed by commit [40a2ab].

     

    Related

    Commit: [40a2ab]

    • Raymond Toy

      Raymond Toy - 2026-07-19

      The commit says you used radcan. Are you sure that's right? radcan sometimes chooses an unexpected branch which is sometimes wrong. I have a vague memory that I removed calls to radcan in various places because that's what was happening to produce incorrect results.

       
      • David Scherfgen

        David Scherfgen - 2026-07-19

        Fair point about radcan in general, but I think we don't need to worry here, for two reasons.

        1. rischint already "radcans" the integrand before it does any real work (intsetup), and uses it in a few other spots too, so by the time this code runs everything's been through radcan anyway. I'm not adding it to a radcan-free path.
        2. I only use it as a test, never in the output. risplit gives me the real and imaginary parts of the antiderivative and I return those unchanged. radcan just helps decide whether a part's derivative is zero, so we can drop it as a constant of integration.
         
        • Raymond Toy

          Raymond Toy - 2026-07-19

          Sounds good. I do wonder now if the existing radcans cause issues. Seems that it's ok. There aren't a lot (if any?) issues on rischint producing bad answers. But haven't checked the bug list in a while for this.

          The mailing list does have examples of radcan simplifying things to zero, but you wouldn't get that by hand because you wouldn't choose those branch cuts.

           
          • David Scherfgen

            David Scherfgen - 2026-07-19

            I've been working on fixing some bugs that are caused by rischint using radcan. Mostly wrong signs in antiderivatives and definite integrals, due to sqrt(x^2) becoming x instead of abs(x) for real x. This will fix tons of bugs in one commit :) Expect a message to the mailing list soon ...

             

Log in to post a comment.

Auth0 Logo