Rules and simplification question (newbie)



On Tue, 23 May 2006 20:02:10 -0700, "Richard Fateman"  wrote:
>the pattern for
>-x^2  looks like
>
>(* -1 (expt x 2))
>
>the pattern for -r^2/t^2
>
>looks like
>(* -1 (expt r 2)(expt t -2))
>
>A product of 3 items.  It won't match a pattern of 2 items.

I guess I was hoping there was some way to make Maxima recognize
r^2/t^2 was also (r/t)^2 and that would match the pattern.

>
>you could try defining a rule like
>matchdeclare (negsquare, negsquarematcher);
>
>defrule (rule1,  exp(negsquare), gp(sqrt(-negsquare)))
>
>now figure out the function negsquarematcher(h) :=   ..... something to test 
>for the case you want....
>
>RJF
>

Thanks.  And thanks to everyone for their help.

Doug