Function reference · Polynomials

deg

Returns the degree of a polynomial.

Without a variable, it is the total degree: the largest sum of powers in any term. With a variable, it is the highest power of that variable.

If the input isn't a polynomial, the call is returned unevaluated.

Notation

deg(x, variable)

Write it in an expression: nerdamer('deg(x^2*y^3+x)'), or in the Playground.

nerdamer.deg

nerdamer.deg(x: ExpressionInput | Polynomial, variable?: ExpressionInput): Expression

A method on the default import. Arguments can be strings, as in Notation.

import { deg }

import { deg } from 'nerdamer/algebra';
deg(x: ExpressionInput | Polynomial, variable?: ExpressionInput): Expression

Import only this function, from nerdamer/algebra.

Examples

Total degree: x^2*y^3 has degree 5.

deg(x^2*y^3+x)
// → 5
Open in Playground

Degree in x.

deg(x^2*y^3+x,x)
// → 2
Open in Playground

Degree in y.

deg(x^2*y^3+x,y)
// → 3
Open in Playground

Not a polynomial: unevaluated.

deg(sin(x))
// → deg(sin(x))
Open in Playground

← Back to Function reference