Revision history [back]

The code

sage: var('x y z')
(x, y, z)
sage: f = 3*x*y + 2*z + 12
sage: f.diff(x)
3*y
sage: g(x,y,z) = 3*x*y + 2*z + 12
sage: g.diff(x)
(x, y, z) |--> 3*y


provides two slightly different ways of defining a function involving x, y, and z, then differentiating with respect to x, thus treating y and z as constants. Is this what you want?