|
From: Richard F. <fa...@gm...> - 2025-11-10 15:30:44
|
I agree with Ray on this. Note that factor operates on the rational form of tst, and rat(tst) produces (x*%e^cos(x+1)+x)/%e^cos(x+1) in essence, the exp(-cos(x+1)) is "simplified" to 1/ exp(cos(x+1)) before factoring. If the user wants exp(-cos(x+1)) to be treated as a single unit, then use a symbol, like emcosxp1 for manipulation, at least until such time as some property related to x or cos ... is needed. factor( x* emcosxp1+x) produces what you might expect. RJF On Mon, Nov 10, 2025 at 9:02 AM Raymond Toy <toy...@gm...> wrote: > > On 11/10/25 1:35 AM, Gunter Königsmann via Maxima-discuss wrote: > > Dear all, > > A colleague of mine has asked me how to factor out the x in > > tst:x*exp(-cos(x+1))+x; > > factor(tst) factorizes the exp() function, as well, which doesn't meet my > colleague's idea of "simple". > > He wants the result to be `x*(1+exp(-cos(x+1))`? > > I thought maybe `factorout` would do this, but it doesn't. > > I've generally given up on finding ways to make Maxima produce the form I > want and just accept what Maxima produces. If I really, really want a > certain form, I just do it by hand. In this case, do `x*expand(tst/x)`. > Sometimes it's just easier to do by hand instead of spending minutes or > hours trying to figure out how to get Maxima to do it. Especially if it's > just a one-time change. > > > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss > |