Maxima users could reasonably expect the main solve function to be able to handle some basic trigonometry. solve is also used internally, e.g. for discontinuity detection in definite integration, and its deficiencies cause manifestly wrong results there. Of course there's to_poly_solve, but its answers can be difficult to handle programmatically.
There is a relatively simple way to make solve handle things like sin(x)+cos(x)+1, and that's tangent-half-angle transformation. It would not be something completely new, because solve already canonicalizes trigonometric and hyperbolic functions by expressing everything in terms of sine/cosine. But it then it fails for anything where two different such functions survive.
to_poly_solveresults are hard to handle programmatically mostly because it handles many more cases correctly and completely, notably periodic functions. I agree that the form of its results can appear complicated and so be off-putting -- can we find a simpler way of expressing the same semantics? For example, we should be able to replaceisnonnegative_p(x)withx>=0?If the inverse trig functions were purely multi valued the solution of, for example, sin(x) = 1/107 could simply be x = asin(1/107). But, to make asin purely multi valued, we would need to prevent asin(1/107) - asin(1/107) from simplifying to zero. We could do that with uniquely labeled boxes, maybe.
Plus, there would need to be a mechanism for a user to select a particular value of asin(1/107). And if an expression involved multiple occurrences of multi valued functions, generating the needed value is a puzzler.
From: Stavros Macrakis via Maxima-bugs maxima-bugs@lists.sourceforge.net
Sent: Monday, 21 September 2026 07:52:05
To: maxima-bugs@lists.sourceforge.net maxima-bugs@lists.sourceforge.net
Cc: Stavros Macrakis macrakis@users.sourceforge.net
Subject: [Maxima-bugs] [maxima:bugs] #5265 solve() should learn some basic trigonometry
Caution: Non-NU Email
to_poly_solve results are hard to handle programmatically mostly because it handles many more cases correctly and completely, notably periodic functions. I agree that the form of its results can appear complicated and so be off-putting -- can we find a simpler way of expressing the same semantics? For example, we should be able to replace isnonnegative_p(x) with x>=0?
[bugs:#5265]https://urldefense.com/v3/__https://sourceforge.net/p/maxima/bugs/5265/__;!!PvXuogZ4sRB2p-tU!C4r4tuMzOw2LaaeBB5WH521pruGKPxxpGYTqvZk0TgRjnhOvxQMxBLM1gtHc13jF4cfEAdAm5d7isy7Kle4E_5G01eLj6g$ solve() should learn some basic trigonometry
Status: open
Group: None
Labels: solve
Created: Fri Sep 18, 2026 09:15 AM UTC by David Scherfgen
Last Updated: Fri Sep 18, 2026 09:15 AM UTC
Owner: nobody
Maxima users could reasonably expect the main solve function to be able to handle some basic trigonometry. solve is also used internally, e.g. for discontinuity detection in definite integration, and its deficiencies cause manifestly wrong results there. Of course there's to_poly_solve, but its answers can be difficult to handle programmatically.
There is a relatively simple way to make solve handle things like sin(x)+cos(x)+1, and that's tangent-half-angle transformation. It would not be something completely new, because solve already canonicalizes trigonometric and hyperbolic functions by expressing everything in terms of sine/cosine. But it then it fails for anything where two different such functions survive.
Sent from sourceforge.net because maxima-bugs@lists.sourceforge.net is subscribed to https://sourceforge.net/p/maxima/bugs/https://urldefense.com/v3/__https://sourceforge.net/p/maxima/bugs/__;!!PvXuogZ4sRB2p-tU!C4r4tuMzOw2LaaeBB5WH521pruGKPxxpGYTqvZk0TgRjnhOvxQMxBLM1gtHc13jF4cfEAdAm5d7isy7Kle4E_5HHQQXEEQ$
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/maxima/admin/bugs/options.https://urldefense.com/v3/__https://sourceforge.net/p/maxima/admin/bugs/options.__;!!PvXuogZ4sRB2p-tU!C4r4tuMzOw2LaaeBB5WH521pruGKPxxpGYTqvZk0TgRjnhOvxQMxBLM1gtHc13jF4cfEAdAm5d7isy7Kle4E_5E_xLoeUg$ Or, if this is a mailing list, you can unsubscribe from the mailing list.
Related
Bugs: #5265