In algebra, a quadratic function, a quadratic polynomial, a polynomial of degree 2, or simply a quadratic, is a polynomial function with one or more variables in which the highest-degree term is of the second degree.

For example, a univariate (single-variable) quadratic function has the form[1]

${\displaystyle f(x)=ax^{2}+bx+c,\quad a\neq 0}$

in the single variable x. The graph of a univariate quadratic function is a parabola whose axis of symmetry is parallel to the y-axis, as shown at right.

If the quadratic function is set equal to zero, then the result is a quadratic equation. The solutions to the univariate equation are called the roots of the univariate function.

The bivariate case in terms of variables x and y has the form

${\displaystyle f(x,y)=ax^{2}+by^{2}+cxy+dx+ey+f\,\!}$

with at least one of a, b, c not equal to zero, and an equation setting this function equal to zero gives rise to a conic section (a circle or other ellipse, a parabola, or a hyperbola).

A quadratic function in three variables x, y, and z contains exclusively terms x2, y2, z2, xy, xz, yz, x, y, z, and a constant:

${\displaystyle f(x,y,z)=ax^{2}+by^{2}+cz^{2}+dxy+exz+fyz+gx+hy+iz+j,}$

with at least one of the coefficients a, b, c, d, e, or f of the second-degree terms being non-zero.

In general there can be an arbitrarily large number of variables, in which case the resulting surface of setting a quadratic function to zero is called a quadric, but the highest degree term must be of degree 2, such as x2, xy, yz, etc.