Inmathematics, the termlinear function refers to two distinct but related notions:[1]

In calculus,analytic geometry and related areas, a linear function is a polynomial of degree one or less, including thezero polynomial. (The latter is a polynomial with no terms, and it is not considered to have degree zero.)
When the function is of only onevariable, it is of the form
wherea andb areconstants, oftenreal numbers. Thegraph of such a function of one variable is a nonvertical line.a is frequently referred to as the slope of the line, andb as the intercept.
Ifa > 0 then thegradient is positive and the graph slopes upwards.
Ifa < 0 then thegradient is negative and the graph slopes downwards.
For a function of any finite number of variables, the general formula is
and the graph is ahyperplane of dimensionk.
Aconstant 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 variable, is a horizontal line.
In this context, a function that is also a linear map (the other meaning of linear functions, see the below) may be referred to as ahomogeneous linear function or alinear form. In the context of linear algebra, the polynomial functions of degree 0 or 1 are the scalar-valuedaffine maps.

In linear algebra, a linear function is a map from avector space to a vector space (Both spaces are not necessarily different.) over a samefieldK such that
Herea denotes a constant belonging to the fieldK ofscalars (for example, thereal numbers), andx andy are elements of, which might beK itself. Even if the same symbol is used, the operation of addition betweenx andy (belonging to) is not necessarily same to the operation of addition between and (belonging to).
In other terms the linear function preservesvector addition andscalar multiplication.
Some authors use "linear function" only for linear maps that take values in the scalar field;[6] these are more commonly calledlinear forms.
The "linear functions" of calculus qualify as "linear maps" when (and only when)f(0, ..., 0) = 0, or, equivalently, when the constantb equals zero in the one-degree polynomial above. Geometrically, the graph of the function must pass through the origin.