This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Euler numbers and polynomials

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.


euler(n, x)


euler(n) returns the n-th Euler number.

euler(n, x) returns the n-th Euler polynomial in x.

The Euler polynomials are defined by the generating function


The Euler numbers are defined by euler(n) = 2^n*euler(n,1/2).

An error occurs if n is a numerical value not representing a nonnegative integer.

If n is an integer larger than the value returned by Pref::autoExpansionLimit(), then the call euler(n) is returned symbolically. Use expand(euler(n)) to get an explicit numerical result for large integers n.

If n contains non-numerical symbolic identifiers, then the call euler(n) is returned symbolically. In most cases, the same holds true for calls euler(n, x). Some simplifications are implemented for special numerical values such as x = 0, x = 1/2, x = 1 etc. for symbolic n . Cf. Example 3.


Note that floating-point evaluation for high degree polynomials may be numerically unstable. See Example 4.

The floating-point evaluation on the standard interval x ∈ [0, 1] is numerically stable for arbitrary n.

To use the Euler constant, call E or exp(1). To use the Euler-Mascheroni constant, call EULER. See Mathematical Constants Available in MuPAD. You can approximate these constants with floating-point numbers by using float.

Environment Interactions

When called with a floating-point value x, the function is sensitive to the environment variable DIGITS which determines the numerical working precision.


Example 1

The first Euler numbers are:

euler(n) $ n = 0..11

The first Euler polynomials:

euler(n, x) $ n = 0..4

If n is symbolic, then a symbolic call is returned:

euler(n, x), euler(n + 3/2, x), euler(n + 5*I, x)

Example 2

If x is not an indeterminate, then the evaluation of the Euler polynomial at the point x is returned:

euler(50, 1 + I)

euler(3, 1 - y) = expand(euler(3, 1 - y))

Example 3

Certain simplifications occur for some special numerical values of x, even if n is symbolic:

euler(n, 0), euler(n, 1/2), euler(n, 1)

Calls with numerical arguments between and 1 are automatically rewritten in terms of calls with arguments between 0 and :

euler(n, 2/3), euler(n, 0.7)

Calls with negative numerical arguments are automatially rewritten in terms of calls with positive arguments:

euler(n, -2)

euler(n, -12.345)

Example 4

Float evaluation of high degree polynomials may be numerically unstable:

exact := euler(50, 1 + I): float(exact);

euler(50, float(1 + I))

DIGITS := 40: euler(50, float(1 + I))

delete exact, DIGITS:

Example 5

Some system functions such as diff or expand handle symbolic calls of euler:

diff(euler(n, f(x)), x)

expand(euler(n, x + 2))

expand(euler(n, -x))

expand(euler(n, 3*x))



An arithmetical expression representing a nonnegative integer


An arithmetical expression

Return Values

Arithmetical expression.


M. Abramowitz and I. Stegun, “Handbook of Mathematical Functions”, Dover Publications Inc., New York (1965).

See Also

MuPAD Functions

Was this topic helpful?