factoring expressions on demand



* Kamaraju Kusumanchi <kamaraju@gmail.com> [2005-08-07 21:51:02 -0400]:

> (%i1) f(x,r) := exp(-x*x+r);
> 
> (%o1) f(x, r) := EXP((- x) x + r)
> (%i2) ratsimp( diff( f(x,r), x, 2) );
> 
> 2
> r 2 r - x
> (%o2) (4 %E x - 2 %E ) %E
> 
> 
> But in (%o2) it could have factored out 2 * exp(r-x*x) instead of just 
> exp(-x*x). How can I tell maxima to factor out these common factors also?
> 

Perhaps.   factor(diff(f(x,r),x,2)) ?

Milan

> thanks
> raju
> 

--