In basic mathematics, a linear function is a function whose graph is a straight line in 2-dimensions (2D, see images). An example is: y=2x–1. In higher mathematics, a linear function often refers to a linear mapping.
Basic Properties
Formally, a linear function is a function f(x):R→R such that the graph of f is a line. This means the domain or input of f is a real number R and the range or output of f is also a real number R. Usually we write y(x) or just y in place of f(x). So the formal statement means: we input or substitute a real number x into the linear function the linear function outputs or gives a real number y and all of these points (x,y) make a line.

There are three main forms for writing linear functions: slope-intercept, standard and parametric.

Slope-intercept form
The slope-intercept (also called point-slope or explicit) form of a linear function is or . This form has 2 variables x and у and 2 constants m and b. The letters m and b are constants. Before working with a linear function, we replace m and b with actual real numbers. The letters x and y are variables. In slope-intercept form, the letter m stands for the slope and b stands for the y-intercept. The variable x is called the independent variable or argument. Any real number x can be input or substituted into a linear function. The function will then output the corresponding value for y. The variable y is called the dependent variable. It is the output value after substituting an input value for x.

Horizontal lines are included. The line is horizontal if and only if m=0. Then we have just y=b. Since b is a real number, this is a constant function. So a constant function is also a linear function. Vertical lines are never included because a vertical line is not a function. A vertical line does not pass the vertical line test. (A vertical line is defined by the equation: x=b where b is a real number.) Slanted lines are included. The line is slanted if and only if m≠0.
The slope-intercept form is unique. A different value of m or a different value of b gives a different line. A linear function is a polynomial function of first or zero degree in one variable х . The constant term is b. If we substitute x=0 into the function, we get y=b. So the number b is the y-intercept and the line crosses the у-axis at the point (0,b). If m≠0, the number –b/m is the x-intercept or root or zero and (–b/m,0) is the point where the line crosses the х-axis. Here the value of the function is zero. The coefficient m of x is called the slope or gradient of the line. For each line, the number m is a constant and so the slope is constant for the whole line. The slope determines both the direction and steepness of the line. Direction and steepness are called the rate of change. So the rate of change is m and it is constant for each line. The sign of m determines the direction. If m>0 then the linear function is increasing; if m<0 then the function is decreasing. The absolute value of m determines the steepness. If |m|<1 then the slope is gentle; if |m|>1 then the slope is steep. If the slope of a line is m and (х,у) is any point on the line, we must also have the point (х+1, y+m) on the line.
Example: y=–2x+4. The slope is m= –2 and the y-intercept is b=4 or the point (0,4). Substituting y=0 and solving for x, we get 0=–2x+4 or x=2. So x=2 is the root of this linear function and the point (2,0) is the x-intercept. Since the slope is m = –2, the line is decreasing. Since |–2|=2>1, the decrease is relatively steep. For each change in х of 1 (to the right), the value of у changes -2 (goes down).
The graph of a line is determined by two points. To graph a linear function, we can substitute two different values for x into the function and solve for the corresponding y-values. We graph these two points. Using a straightedge, we draw the line through these two points extending it past both points.
Example: y=–2x+4. Substituting x=0 we get y=4 (this is the y-intercept) and thus the point (0,4). Substituting x=1, we get y=2 and thus the point (1,2). Plot these points and draw the line. (Notice that the 2nd point is 1 to the right and 2 down from the 1st point. As we said in the above example, this happens because the slope is m= –2)
A linear function that is not a constant function is a bijection. It will output each real number (surjection) for exactly one input value (injection).
Example: y= –x+2. Suppose y= –1. We substitute y= –1 and get: –1= –'x+2 or x=3. This is the only solution. We can do this for any y-value.





