'Computes partial derivative in ``x``.
Examples
>>> from sympy.polys.fields import field
>>> from sympy.polys.domains import ZZ
>>> _, x, y, z = field("x,y,z", ZZ)
>>> ((x**2 + y)/(z + 1)).diff(x)
2*x/(z + 1)'

def diff(f, x):

    x = x.to_poly()
    return f.new(((f.numer.diff(x) * f.denom) - (f.numer * f.denom.diff(x))), (f.denom ** 2))
