# Linear function

In mathematics, the term linear function refers to two distinct, although related, notions:

## As a polynomial function

{{#invoke:main|main}}

In calculus, analytic geometry and related areas, a linear function is a polynomial of degree one or less, including the zero polynomial (the latter not being considered to have degree zero).

When the function is of only one variable, it is of the form

$f(x)=ax+b,$ where Template:Mvar and Template:Mvar are constants, often real numbers. The graph of such a function of one variable is a nonvertical line. Template:Mvar is frequently referred to as the slope of the line, and Template:Mvar as the intercept.

For a function $f(x_{1},\ldots ,x_{k})$ of any finite number independent variables, the general formula is

$f(x_{1},\ldots ,x_{k})=b+a_{1}x_{1}+\ldots +a_{k}x_{k}$ ,

and the graph is a hyperplane of dimension k.

A constant function is also considered linear in this context, as it is a polynomial of degree zero or is the zero polynomial. Its graph, when there is only one independent variable, is a horizontal line.

In this context, the other meaning (a linear map) may be referred to as a homogeneous linear function or a linear form. In the context of linear algebra, this meaning (polynomial functions of degree 0 or 1) is a special kind of affine map.

## As a linear map

{{#invoke:main|main}}

In linear algebra, a linear function is a map f between two vector spaces that preserves vector addition and scalar multiplication:

$f({\mathbf {x} }+{\mathbf {y} })=f({\mathbf {x} })+f({\mathbf {y} })$ $f(a\mathbf {x} )=af(\mathbf {x} ).$ Here a denotes a constant belonging to some field K of scalars (for example, the real numbers) and x and y are elements of a vector space, which might be K itself.

Some authors use "linear function" only for linear maps that take values in the scalar field; these are also called linear functionals.