# [Maxima] Simplification and alike1

Stavros Macrakis macrakis at alum.mit.edu
Fri Jan 16 17:12:04 CST 2009

```On Fri, Jan 16, 2009 at 12:07 PM, Raymond Toy <raymond.toy at ericsson.com> wrote:
> ...There is a test (alike1 (add 1 (mul 2 a1)) c) that fails.  (a1 = (a+b-1/2)/2 = (2*A+11/3)/2)
> We want this test to succeed because 2*a1+1 actually does equal c, when everything is expanded out.
> What is the best way to achieve this?  I could call \$expand or \$ratsimp in hyp-cos, but I'm not sure what is right, or if something else should be used.

The best way to do this in this case is to check whether
is(equal(2*a1+1,c)) (using the appropriate Lisp calls, which I don't
remember off the top of my head).  This will also take into account
the assume database.

In general, Maxima's philosophy is that the simplification of f(ex)
should not radically change the form of ex or perform expensive
operations on it like expand or ratsimp -- if a simplification depends
on an argument being in a particular form (e.g. ratsimp'ed or
expand'ed), doing that should be left to the user.  The general
simplifier does not, for example, perform GCDs in divisions so that
users don't have (x^100-1)/(x-1) expand into 100 terms.

is/equal itself does call ratsimp, and should not be called
promiscuously by simplifying functions, but in the case of
hypergeometric function order arguments, that seems fine to me.

> (Even if this is fixed, the result, it's hard to tell if the answer is
> correct or not.  It differs from the answer given in Avgoustis'
> thesis.)