extended "coeff()" function



I just searched the Maxima manual for ratcoeff, and it said "no topics found".

At 05:21 PM 6/25/2012, andre maute wrote:
>On 06/26/2012 01:55 AM, Henry Baker wrote:
>>You already know that coeff(expression,var,n) doesn't work unless "expression" is expanded, which is ok, although minorly irritating.
>>
>>But it would be nice if coeff(expression,x*y,n)=coeff(coeff(expression,x,n),y,n), so that you could pick out the coefficients of (x*y)^n, where n is usually 1.
>>
>>Thus, if p = x^2 + 2 x y + y^2, coeff(p,x*y,1) should be 2.  (It currently returns 0.)
>doesn't ratcoef() work?
>
>[user at localhost ]$ maxima -b ratcoef.mac
>Maxima 5.27.0 http://maxima.sourceforge.net
>using Lisp SBCL 1.0.57-1.fc17
>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.
>STYLE-WARNING: redefining MAXIMA::$FILE_TYPE in DEFUN
>(%i1)                         batch(ratcoef.mac)
>
>read and interpret file: /home/user/ratcoef.mac
>(%i2)                          display2d : false
>(%o2) false
>(%i3) p:y^2+2*x*y+x^2
>(%o3) y^2+2*x*y+x^2
>(%i4) ratcoef(p,x*y,1)
>(%o4) 2
>(%o4) "/home/user/ratcoef.mac"