Chain rule with abstract functions?



   >From mailnull  Fri May 31 14:21:58 2013
   Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of math.utexas.edu designates 146.6.25.6 as permitted sender) client-ip=146.6.25.6; envelope-from=maxima-bounces at math.utexas.edu; helo=irongate.mail.utexas.edu;
   Date: Sat, 1 Jun 2013 00:20:33 +1000
   From: Alasdair McAndrew <amca01 at gmail.com>
   Content-Type: multipart/mixed;
	   boundary="===============2978410035570817933=="

   --===============2978410035570817933==
   Content-Type: multipart/alternative; boundary="047d7b677a186c0cdf04de0451aa"

   --047d7b677a186c0cdf04de0451aa
   Content-Type: text/plain; charset="ISO-8859-1"

   Something similar may have been asked before, but anyway... is there a way
   to coerce Maxima to differentiate, say f(x,y(x)) with respect to x, and
   produce

   D(f)(x) + f.D(f)(y) ?

   Or to differentiate f(y(x)) and produce

   D(f)(y).D(y)(x) ?

   Thanks.

Option 1. 
load('pdiff);

Option 2.
Use diff and subst:

subst([del(x)=1, del(y)='diff(y,x)], diff(f(x,y)));

Leo