Learn R Programming

mpoly (version 1.1.2)

deriv.mpoly: Compute partial derivatives of a multivariate polynomial.

Description

This is a deriv method for mpoly objects. It does not call the stats::deriv().

Usage

# S3 method for mpoly
deriv(expr, var, ..., bring_power_down = TRUE)

Value

An object of class mpoly or mpolyList.

Arguments

expr

an object of class mpoly

var

character - the partial derivative desired

...

any additional arguments

bring_power_down

if FALSE, x^n -> x^(n-1), not n x^(n-1)

Examples

Run this code
p <- mp("x y + y z + z^2")
deriv(p, "x")
deriv(p, "y")
deriv(p, "z")
deriv(p, "t")
deriv(p, c("x","y","z"))

is.mpoly(deriv(p, "x"))
is.mpolyList( deriv(p, c("x","y","z")) )

p <- mp("x^5")
deriv(p, "x")
deriv(p, "x", bring_power_down = FALSE)

Run the code above in your browser using DataLab