# Linear function

In mathematics, the term linear function can refer to either of two different but related concepts.

## Usage in elementary mathematics

File:Linear functions2.PNG
Three geometric linear functions — the red and blue ones have the same slope (m), while the red and green ones have the same y-intercept (b).

In elementary algebra and analytic geometry, the term linear function is sometimes used to mean a first degree polynomial function of one variable. These functions are called "linear" because they are precisely the functions whose graph in the Cartesian coordinate plane is a straight line.

Such a function can be written as

${\displaystyle f(x)=mx+b}$

(called slope-intercept form), where ${\displaystyle m}$ and ${\displaystyle b}$ are real constants and ${\displaystyle x}$ is a real variable. The constant ${\displaystyle m}$ is often called the slope or gradient, while ${\displaystyle b}$ is the y-intercept, which gives the point of intersection between the graph of the function and the ${\displaystyle y}$-axis. Changing ${\displaystyle m}$ makes the line steeper or shallower, while changing ${\displaystyle b}$ moves the line up or down.

Examples of functions whose graph is a line include the following:

• ${\displaystyle f_{1}(x)=2x+1}$
• ${\displaystyle f_{2}(x)=x/2+1}$
• ${\displaystyle f_{3}(x)=x/2-1}$

The graphs of these are shown in the image at right.

For example, if ${\displaystyle x}$ and ${\displaystyle f(x)}$ are represented as coordinate vectors, then the linear functions are those functions that can be expressed as
${\displaystyle f(x)=\mathrm {M} x}$, where M is a matrix.
A function ${\displaystyle f(x)=mx+b}$ is a linear map if and only if ${\displaystyle b=0}$. For other values of ${\displaystyle b}$ this falls in the more general class of affine maps.