Partial Derivatives Question

Hi there,

This is from an econ textbook, but the content is all math. The example in the book starts from the following identity:

D(*p*) = S(*p*,*a*)

Where p and a are variables. Furthermore *p* = *p*(*a*), so the new equation given is:

D(*p*(*a*)) = S(*p*(*a*), *a*).

The following part is where the book loses me, and they do not do a very good job of showing how these equations are derived. I haven't been exposed to partial derivatives yet, but know what they are. I just don't understand how the book gets this derivative:

(dD(*p*(*a*))/d*p*) d*p*/d*a* = (partialdS(*p*(*a*), *a*))/(partiald*p*) (d*p*/d*a*) + (partialdS(*p*(*a*), *a*))/(partiald*a*)

Sorry if that is really messy, but I'm not sure how to use the tags. This isn't a homework problem or anything, I just really want to know how that equation is derived. Any help would be greatly appreciated.