# diff(RingElement,RingElement) -- differentiation

## Synopsis

• Function: diff
• Usage:
diff(x,f)
• Inputs:
• x, , a polynomial
• f, , a polynomial in the same ring as x
• Outputs:
• , the result of differentiating f by the differential operator corresponding to x.

## Description

If x is an indeterminate this is simply the usual differentiation.
 i1 : R = QQ[x,y,z]; i2 : diff(x,x^7 + 4*x^3*y - 3*y) 6 2 o2 = 7x + 12x y o2 : R i3 : diff(x^2+y^2+z^2, y^2*z^2 - x^3 - 1) 2 2 o3 = 2y + 2z - 6x o3 : R
Here is a shortcut that can save some typing.
 i4 : diff_x x^6 5 o4 = 6x o4 : R