Function reference · Polynomials

deg

Returns the degree of a polynomial expression.

With no variable argument, deg returns the total degree: the largest sum of powers in any term. With a variable, it returns the largest power of that variable while treating other variables as coefficients.

If the input cannot be converted to a polynomial, the operation remains symbolic.

Examples

These examples use Nerdamer Notation.

Return the total degree of a multivariable polynomial.

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

Return the degree with respect to x.

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

Return the degree with respect to y.

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

Interfaces

The same operation is available through the interfaces below.

Nerdamer Notation · nerdamer API · Direct API

Nerdamer Notation

Use this form inside input passed to nerdamer(...).

deg(arg1, [arg2])

nerdamer.deg

Call the operation through the default nerdamer import.

nerdamer.deg(x: ExpressionInput | Polynomial): Expression

Parameters

NameTypeDescription
xExpressionInput | PolynomialExpression-like input or polynomial to inspect.

Returns

Expression — A numeric expression for a converted polynomial, otherwise an unevaluated symbolic `deg` call.

Browse the nerdamer API →

Direct JavaScript / TypeScript API

Import the operation directly from its package entry point.

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

Parameters

NameTypeDescription
xExpressionInput | PolynomialExpression-like input or polynomial to inspect.

Returns

Expression — A numeric expression for a converted polynomial, otherwise an unevaluated symbolic `deg` call.

Browse nerdamer/algebra

← Back to Reference