Arithmetic with multivariate polynomials

# S3 method for mpoly
+(e1, e2)

# S3 method for mpoly
-(e1, e2)

# S3 method for mpoly
*(e1, e2)

# S3 method for mpoly
^(e1, e2)

# S3 method for mpolyList
^(e1, e2)

Arguments

e1

an object of class mpoly

e2

an object of class mpoly

Value

object of class mpoly

Examples

p <- mp("x + y") p + p
#> 2 x + 2 y
p - p
#> 0
p * p
#> x^2 + 2 x y + y^2
p^2
#> x^2 + 2 x y + y^2
p^10
#> x^10 + 10 x^9 y + 45 x^8 y^2 + 120 x^7 y^3 + 210 x^6 y^4 + 252 x^5 y^5 + 210 x^4 y^6 + 120 x^3 y^7 + 45 x^2 y^8 + 10 x y^9 + y^10
mp("(x+1)^10")
#> x^10 + 10 x^9 + 45 x^8 + 120 x^7 + 210 x^6 + 252 x^5 + 210 x^4 + 120 x^3 + 45 x^2 + 10 x + 1
p + 1
#> x + y + 1
2*p
#> 2 x + 2 y