Factoring matrix expressions, even trivial ones?



Even if there *is* a built-in function for something, for simple cases like
this, it is often quicker and easier to built it from the basics -- which
also means you have more flexibility in defining its exact behavior.  It
can be useful to think of Maxima as a programming language with a
collection of libraries specialized in symbolic calculation rather than a
symbolic algebra calculator with an extension language.

Didn't some great scientist quip that it was sometimes easier to find
things in the "library of nature" (i.e. (re)do the
measurement/experiment/derivation yourself) than in the scholarly
literature -- where you may or may not find the answer you're looking for?
   I'd be interested in finding good sources for that concept.

            -s


On Fri, May 3, 2013 at 12:44 PM, Henry Baker <hbaker1 at pipeline.com> wrote:

> Hi Paul:
>
> The problem is that with a very large/complicated matrix, I might not be
> able to easily notice what factors exist in every entry.
>
> Stavros basically answered my question in the negative: there isn't a
> built-in way to do this, but by 'flattening' the matrix
> into a list, he can compute the GCD of this list, and then divide it out.
>
> At 09:19 AM 5/3/2013, Paul Bowyer wrote:
> >On 05/03/2013 06:30 AM, Henry Baker wrote:
> >>Is there any way for Maxima to factor 'a' back out of a*M, as below?
> >>
> >>Maxima 5.28.0-2 http://maxima.sourceforge.net
> >>using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (a.k.a. GCL)
> >>Distributed under the GNU Public License. See the file COPYING.
> >>Dedicated to the memory of William Schelter.
> >>The function bug_report() provides bug reporting information.
> >>(%i1) M:transpose([x,y]);
> >>                                      [ x ]
> >>(%o1)                                [   ]
> >>                                      [ y ]
> >>(%i2) a*M;
> >>                                     [ a x ]
> >>(%o2)                               [     ]
> >>                                     [ a y ]
> >>(%i3) %,factor;
> >>                                     [ a x ]
> >>(%o3)                               [     ]
> >>                                     [ a y ]
> >>(%i4) ????
> >
> >Does this do want you want? (My ignorance might be showing)
> >
> >M:transpose([x,y]);
> >M2:a*M;
> >M:M2/a;
> >
> >Paul Bowyer
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>