Main Content


Hermite polynomials



hermiteH(n,x) represents the nth-degree Hermite polynomial at the point x.


collapse all

Find the first five Hermite polynomials for the variable x.

syms x
hermiteH([0 1 2 3 4], x)
ans =
[ 1, 2*x, 4*x^2 - 2, 8*x^3 - 12*x, 16*x^4 - 48*x^2 + 12]

Depending on whether the input is numeric or symbolic, hermiteH returns numeric or exact symbolic results.

Find the value of the fifth-degree Hermite polynomial at 1/3. Because the input is numeric, hermiteH returns numeric results.

ans =

Find the same result for exact symbolic input. hermiteH returns an exact symbolic result.

ans =

Plot the first five Hermite polynomials.

syms x y
axis([-2 2 -30 30])
grid on

legend('H_0(x)', 'H_1(x)', 'H_2(x)', 'H_3(x)', 'H_4(x)', 'Location', 'Best')
title('Hermite polynomials')

Figure contains an axes. The axes with title Hermite polynomials contains 5 objects of type functionline. These objects represent H_0(x), H_1(x), H_2(x), H_3(x), H_4(x).

Input Arguments

collapse all

Degree of the polynomial, specified as a nonnegative integer, symbolic variable, expression, or function, or as a vector or matrix of numbers, symbolic numbers, variables, expressions, or functions.

Input, specified as a number, vector, matrix, or array, or a symbolic number, variable, array, function, or expression.

More About

collapse all

Hermite Polynomials

Hermite polynomials are defined by this recursion formula.


Hermite polynomials in MATLAB® satisfy this normalization.



  • hermiteH returns floating-point results for numeric arguments that are not symbolic objects.

  • hermiteH acts element-wise on nonscalar inputs.

  • At least one input argument must be a scalar or both arguments must be vectors or matrices of the same size. If one input argument is a scalar and the other one is a vector or a matrix, then hermiteH expands the scalar into a vector or matrix of the same size as the other argument with all elements equal to that scalar.


[1] Hochstrasser, U. W. “Orthogonal Polynomials.” Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. (M. Abramowitz and I. A. Stegun, eds.). New York: Dover, 1972.

Introduced in R2014b