From: Barton W. <wi...@un...> - 2023-09-30 18:50:31
|
If you get an expression that involves atan2(sin(x), cos(x)), you can try to clean it up with a tellsimpafter rule. Maybe something like (%i2) matchdeclare(xxx, lambda([q], true))$ (%i3) tellsimpafter(atan2(sin(xxx), cos(xxx)), xxx - 2*%pi * ceiling((xxx-%pi)/(2*%pi)))$ (%i4) atan2(sin(x), cos(x)); (%o4) x-2*%pi*ceiling((x-%pi)/(2*%pi)) Assuming -%ip < x <= %pi cleans up this mess: (%i5) assume(-%pi < x, x <= %pi)$ (%i6) atan2(sin(x), cos(x)); (%o6) x Or was there something else that was overly complex? Would a simple assume clean it up? You should check that the function xxx --> xxx - 2*%pi * ceiling((xxx-%pi)/(2*%pi) is OK—it’s a bit tricky for me to remember. --Barton From: Michael Gough<mailto:inn...@gm...> Sent: Saturday, September 30, 2023 12:59 PM To: <max...@li...><mailto:max...@li...> Subject: [Maxima-discuss] Avoiding trig in calculus solutions Non-NU Email Hi gang, I have a calculus problem and Maxima's solution is riddled with atan2 and sin and cos. I want to invoke some e ratpolywhatever declaration to get rid of those. Mike |