solve(eq,P^2) won't work and a negative sign issue

It's a simple equation where I'm just getting maple to run through the steps.

eq:=(m+M)=a^3/P^2; 

solve(eq,P^2);   returns an unexpected error

I wanted to see if maple could solve for P^2, poking here and there seeing what does and doesn't work.  I know I could just type it in, but can Maple do this?  Maybe I'm missing something.

Again using the same equation (sorry i don't have maple in front of me right now) but if I solve for m I get something reversed, i think after i simplify.  -M + a^3/P^2     Is there anyway to reverse the order of the answer? 

 

acer's picture

in a way

> eq:=(m+M)=a^3/P^2;
                                              3
                                             a
                              eq := m + M = ----
                                              2
                                             P

> solve(algsubs(P^(-2)=Z,eq),Z);
                                     m + M
                                     -----
                                       3
                                      a

It can be very difficult to control the order of printing of terms in sums, unless one resorts to subverting the mechanism (using the `` operator, for example). I believe that it depends on the order in which the terms appear in some structure (simpl table) internal to the kernel, and that may be based on memory address and thus be session dependent.

> restart:
> eq:=(m+M)=a^3/P^2:
> expand(solve(eq,m));
                                          3
                                         a
                                   -M + ----
                                          2
                                         P

> restart:
> a^3/P^2-M:
> eq:=(m+M)=a^3/P^2:
> expand(solve(eq,m));
                                     3
                                    a
                                   ---- - M
                                     2
                                    P

acer

with isolate

 isolate(eq,P^2);
                                                    3
                                           2       a
                                          P  = - ------
                                                 -m - M

Do not claim for the minus signs :)

Doug Meade's picture

simplify helps

To remove the minus signs, use simplify:

isolate( eq, P^2 );
                                          3  
                                 2       a   
                                P  = - ------
                                       -m - M
simplify( % );
                                        3  
                                  2    a   
                                 P  = -----
                                      m + M

(normal and factor also work, but not expand)

Doug

---------------------------------------------------------------------
Douglas B. Meade  <><
Math, USC, Columbia, SC 29208  E-mail: mailto:meade@math.sc.edu       
Phone:  (803) 777-6183         URL:    http://www.math.sc.ed
acer's picture

reference

I believe that "minus signs" was a reference to the original poster's problem when solving for m, of the -M term being at the fore of the sum.

And in case anyone is interested, according to the session history, the same type of issue might occur when using `isolate`.

> restart:
> -M+a^3/P^2:
> eq:=(m+M)=a^3/P^2:
> isolate( eq, m );
                                            3
                                           a
                                 m = -M + ----
                                            2
                                           P

> restart:
> eq:=(m+M)=a^3/P^2:
> isolate( eq, m );
                                       3
                                      a
                                 m = ---- - M
                                       2
                                      P

acer

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
}