simple simplification fails?



No, there is not a "max simplification search depth".
 
It would be nice if you didn't change your notation from line to line, e.g.
do you want rx or dx.
 
If you detect a common subexpression, E and want to replace it by F, then
try
subst(F,E, expression)
 
or 
ratsubst(F, E, expression).
 
Ordinarily there are many possible such substitutions, and which one makes
the most sense is
not always obvious.  Trying "all" substitutions is hardly practical except
for very small expressions.
 
RJF
 


  _____  

From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu]
On Behalf Of Joost Witteveen
Sent: Thursday, February 28, 2008 8:10 AM
To: maxima at math.utexas.edu
Subject: simple simplification fails?


When I ask maxima to
integrate(x/((x+dx*r)^2+(y+dy*r)^2+(z+dz*r)^2)^(3/2),r); it does give a
result that could be easily (even I could do it) simplified a lot (see
output below).

I notice that for (slightly) simpler integrals, maxima does simplify the
result, so it seems it has hit a max simplification-search-depth somewhere,
given up, and dumped the not-simplified result. 
 

Is there a variable I can set so that maxima will try harder to simplify?
(at the moment, the results comes just about instantly).



(%i133) integrate(x/((x+rx*r)^2+(y+ry*r)^2+(z+rz*r)^2)^(3/2),r);
                              2        2     2     2    2    2    2
Is  (2 rz z + 2 ry y + 2 rx x)  - 4 (rz  + ry  + rx ) (z  + y  + x )
                                                               zero or
nonzero?

n;
                         2                                   2    2
(%o133) x (4 rz z/(sqrt(z  + r (2 rz z + 2 ry y + 2 rx x) + y  + x
    2    2     2     2         2     2     2    2    2    2
 + r  (rz  + ry  + rx )) (4 (rz  + ry  + rx ) (z  + y  + x )
                             2
 - (2 rz z + 2 ry y + 2 rx x) )) + 4 ry y
        2                                   2    2    2    2     2     2
/(sqrt(z  + r (2 rz z + 2 ry y + 2 rx x) + y  + x  + r  (rz  + ry  + rx ))
       2     2     2    2    2    2                              2
 (4 (rz  + ry  + rx ) (z  + y  + x ) - (2 rz z + 2 ry y + 2 rx x) ))
                 2                                   2    2
 + 4 rx x/(sqrt(z  + r (2 rz z + 2 ry y + 2 rx x) + y  + x
    2    2     2     2         2     2     2    2    2    2
 + r  (rz  + ry  + rx )) (4 (rz  + ry  + rx ) (z  + y  + x )
                             2            2     2     2
 - (2 rz z + 2 ry y + 2 rx x) )) + 4 r (rz  + ry  + rx )
        2                                   2    2    2    2     2     2
/(sqrt(z  + r (2 rz z + 2 ry y + 2 rx x) + y  + x  + r  (rz  + ry  + rx ))
       2     2     2    2    2    2                              2
 (4 (rz  + ry  + rx ) (z  + y  + x ) - (2 rz z + 2 ry y + 2 rx x) )))
(%i134) f90(%);
x*(4*rz*z/ &
     (sqrt(z**2+r*(2*rz*z+2*ry*y+2*rx*x)+y**2+x**2+r**2*(rz** &
     2+ry**2+rx**2))*(4*(rz**2+ry**2+rx**2)*(z**2+y**2+x**2)-(2* &
     rz*z+2*ry*y+2*rx*x)**2))+4*ry*y/ &
     (sqrt(z**2+r*(2*rz*z+2*ry*y+2*rx*x)+y**2+x**2+r**2*(rz** &
     2+ry**2+rx**2))*(4*(rz**2+ry**2+rx**2)*(z**2+y**2+x**2)-(2* &
     rz*z+2*ry*y+2*rx*x)**2))+4*rx*x/ &
     (sqrt(z**2+r*(2*rz*z+2*ry*y+2*rx*x)+y**2+x**2+r**2*(rz** &
     2+ry**2+rx**2))*(4*(rz**2+ry**2+rx**2)*(z**2+y**2+x**2)-(2* &
     rz*z+2*ry*y+2*rx*x)**2))+4*r*(rz**2+ry**2+rx**2)/ &
     (sqrt(z**2+r*(2*rz*z+2*ry*y+2*rx*x)+y**2+x**2+r**2*(rz** &
     2+ry**2+rx**2))*(4*(rz**2+ry**2+rx**2)*(z**2+y**2+x**2)-(2* &
     rz*z+2*ry*y+2*rx*x)**2)))


(I show the f90() output for those that read with proportional font).
In the result, this is repeated 4 times:

 
(sqrt(z**2+r*(2*rz*z+2*ry*y+2*rx*x)+y**2+x**2+r**2*(rz**2+ry**2+rx**2))*
     (4*(rz**2+ry**2+rx**2)*(z**2+y**2+x**2)-(2*rz*z+2*ry*y+2*rx*x)**2))

So, the whole result can (at least) be simplified as:
4*x*(rx*x+ry*y+rz*z + r*(rx**2+ry**2+rz**2))/
(sqrt(z**2+r*(2*dz*z+2*dy*y+2*dx*x)+y**2+x**2+(dz**2+dy** &
     2+dx**2)*r**2)*(4*(dz**2+dy**2+dx**2)*(z**2+y**2+x**2)-(2* &
     dz*z+2*dy*y+2*dx*x)**2))

Thanks,
joost witteveen