Linear function (calculus)

In calculus and related areas of mathematics, a linear function from the real numbers to the real numbers is a function whose graph (in Cartesian coordinates) is a line in the plane. 
The characteristic property of linear functions is that when the input variable is changed, the change in the output is proportional to the change in the input.
Linear functions are related to linear equations.
Properties.
A linear function is a polynomial function in which the variable has degree at most one:
Such a function is called "linear" because its graph, the set of all points formula_2 in the Cartesian plane, is a line. The coefficient "a" is called the "slope" of the function and of the line (see below).
If the slope is formula_3, this is a "constant function" formula_4 defining a horizontal line, which some authors exclude from the class of linear functions. With this definition, the degree of a linear polynomial would be exactly one, and its graph would be a line that is neither vertical nor horizontal. However, in this article, formula_5 is required, so constant functions will be considered linear.
If formula_6 then the linear function is said to be "homogeneous". Such function defines a line that passes through the origin of the coordinate system, that is, the point formula_7. In advanced mathematics texts, the term "linear function" often denotes specifically homogeneous linear functions, while the term affine function is used for the general case, which includes formula_8.
The natural domain of a linear function formula_9, the set of allowed input values for , is the entire set of real numbers, formula_10 One can also consider such functions with in an arbitrary field, taking the coefficients in that field.
The graph formula_11 is a non-vertical line having exactly one intersection with the -axis, its -intercept point formula_12 The -intercept value formula_13 is also called the "initial value" of formula_14 If formula_15 the graph is a non-horizontal line having exactly one intersection with the -axis, the -intercept point formula_16 The -intercept value formula_17 the solution of the equation formula_18 is also called the "root" or "zero" of formula_14
Slope.
The slope of a nonvertical line is a number that measures how steeply the line is slanted (rise-over-run). If the line is the graph of the linear function formula_20, this slope is given by the constant .
The slope measures the constant rate of change of formula_9 per unit change in "x": whenever the input is increased by one unit, the output changes by units: formula_22, and more generally formula_23 for any number formula_24. If the slope is positive, formula_25, then the function formula_9 is increasing; if formula_27, then formula_9 is decreasing
In calculus, the derivative of a general function measures its rate of change. A linear function formula_1 has a constant rate of change equal to its slope , so its derivative is the constant function formula_30.
The fundamental idea of differential calculus is that any smooth function formula_9 (not necessarily linear) can be closely approximated near a given point formula_32 by a unique linear function. The derivative formula_33 is the slope of this linear function, and the approximation is: formula_34 for formula_35. The graph of the linear approximation is the tangent line of the graph formula_36 at the point formula_37. The derivative slope formula_33 generally varies with the point "c". Linear functions can be characterized as the only real functions whose derivative is constant: if formula_30 for all "x", then formula_1 for formula_41.
Slope-intercept, point-slope, and two-point forms.
A given linear function formula_9 can be written in several standard formulas displaying its various properties. The simplest is the "slope-intercept form": 
from which one can immediately see the slope "a" and the initial value formula_44, which is the "y"-intercept of the graph formula_36.
Given a slope "a" and one known value formula_46, we write the "point-slope form": 
In graphical terms, this gives the line formula_36 with slope "a" passing through the point formula_49.
The "two-point form" starts with two known values formula_46 and formula_51. One computes the slope formula_52 and inserts this into the point-slope form: 
Its graph formula_36 is the unique line passing through the points formula_55. The equation formula_36 may also be written to emphasize the constant slope:
Relationship with linear equations.
Linear functions commonly arise from practical problems involving variables formula_58 with a linear relationship, that is, obeying a linear equation formula_59. If formula_60, one can solve this equation for "y", obtaining
where we denote formula_62 and formula_63. That is, one may consider "y" as a dependent variable (output) obtained from the independent variable (input) "x" via a linear function: formula_64. In the "xy"-coordinate plane, the possible values of formula_65 form a line, the graph of the function formula_9. If formula_67 in the original equation, the resulting line formula_68 is vertical, and cannot be written as formula_36.
The features of the graph formula_64 can be interpreted in terms of the variables "x" and "y". The "y"-intercept is the initial value formula_13 at formula_72. The slope "a" measures the rate of change of the output "y" per unit change in the input "x". In the graph, moving one unit to the right (increasing "x" by 1) moves the "y"-value up by "a": that is, formula_73. Negative slope "a" indicates a decrease in "y" for each increase in "x".
For example, the linear function formula_74 has slope formula_75, "y"-intercept point formula_76, and "x"-intercept point formula_77.
Example.
Suppose salami and sausage cost €6 and €3 per kilogram, and we wish to buy €12 worth. How much of each can we purchase? If "x" kilograms of salami and "y" kilograms of sausage costs a total of €12 then, €6×"x" + €3×"y" = €12. Solving for "y" gives the point-slope form formula_74, as above. That is, if we first choose the amount of salami "x", the amount of sausage can be computed as a function formula_79. Since salami costs twice as much as sausage, adding one kilo of salami decreases the sausage by 2 kilos: formula_80, and the slope is −2. The "y"-intercept point formula_81 corresponds to buying only 4 kg of sausage; while the "x"-intercept point formula_82 corresponds to buying only 2 kg of salami.
Note that the graph includes points with negative values of "x" or "y", which have no meaning in terms of the original variables (unless we imagine selling meat to the butcher). Thus we should restrict our function formula_9 to the domain formula_84.
Also, we could choose "y" as the independent variable, and compute "x" by the inverse linear function: formula_85 over the domain formula_86.
Relationship with other classes of functions.
If the coefficient of the variable is not zero (), then a linear function is represented by a degree 1 polynomial (also called a "linear polynomial"), otherwise it is a constant function – also a polynomial function, but of zero degree.
A straight line, when drawn in a different kind of coordinate system may represent other functions.
For example, it may represent an exponential function when its values are expressed in the logarithmic scale. It means that when is a linear function of , the function is exponential. With linear functions, increasing the input by one unit causes the output to increase by a fixed amount, which is the slope of the graph of the function. With exponential functions, increasing the input by one unit causes the output to increase by a fixed multiple, which is known as the base of the exponential function.
If "both" arguments and values of a function are in the logarithmic scale (i.e., when is a linear function of ), then the straight line represents a power law:
On the other hand, the graph of a linear function in terms of polar coordinates: 
is an Archimedean spiral if formula_89 and a circle otherwise.