Stavros,
Thanks very much for your email, Approach 2 works like a charm and does
exactly what I had hoped for. Much obliged.
Ian
----
Ian Bell
Graduate Research Assistant
Herrick Labs
Purdue University
email: ibell at purdue.edu
cell: (607)227-7626
On Tue, Sep 21, 2010 at 2:44 PM, Stavros Macrakis <macrakis at alum.mit.edu>wrote:
> Sorry, Approach 3 is really Approach 2A -- the argument to substpart
> shouldn't be expr, but the result of Approach 2:
>
>
>> ----------------Approach 2-------------------------------
>> expr1: subst(x-a,'xa,ratsubst('xa,x-a,expr)); <<< ratsubst does the
>> heavy lifting
>> => (3*(x-a)^2-6)*sin(x)+(6*(x-a)-(x-a)^3)*cos(x)
>>
>> -----------------Approach 2A------------------------------
>> pullout(ex,q):=q*multthru(1/q,ex)$
>> substpart(pullout(piece,x-a),expr1,2,1); <<< pull out x-a from the 2nd
>> term
>> => (3*(x-a)^2-6)*sin(x)+(x-a)*(6-(x-a)^2)*cos(x)
>>
>>