diff --git a/src/sage/rings/polynomial/polynomial_template.pxi b/src/sage/rings/polynomial/polynomial_template.pxi index f34916f7212..33f97698cda 100644 --- a/src/sage/rings/polynomial/polynomial_template.pxi +++ b/src/sage/rings/polynomial/polynomial_template.pxi @@ -804,43 +804,3 @@ cdef class Polynomial_template(Polynomial): if not have_ring: self.parent()._singular_(singular).set_ring() #this is expensive return singular(self._singular_init_()) - - def _derivative(self, var=None): - r""" - Returns the formal derivative of self with respect to var. - - var must be either the generator of the polynomial ring to which - this polynomial belongs, or None (either way the behaviour is the - same). - - .. SEEALSO:: :meth:`.derivative` - - EXAMPLES:: - - sage: R. = Integers(77)[] - sage: f = x^4 - x - 1 - sage: f._derivative() - 4*x^3 + 76 - sage: f._derivative(None) - 4*x^3 + 76 - - sage: f._derivative(2*x) - Traceback (most recent call last): - ... - ValueError: cannot differentiate with respect to 2*x - - sage: y = var("y") - sage: f._derivative(y) - Traceback (most recent call last): - ... - ValueError: cannot differentiate with respect to y - """ - if var is not None and var is not self._parent.gen(): - raise ValueError("cannot differentiate with respect to %s" % var) - - P = self.parent() - x = P.gen() - res = P(0) - for i,c in enumerate(self.list()[1:]): - res += (i+1)*c*x**i - return res