Expand menu menu_open Minimize Start chapters Home History history History expand_more
{{ item.displayTitle }}
No history yet!
Progress & Statistics equalizer Progress expand_more
{{ filterOption.label }}
{{ item.displayTitle }}
{{ item.subject.displayTitle }}
No results
{{ searchError }}
{{ courseTrack.displayTitle }}
{{ statistics.percent }}% Sign in to view progress
{{ printedBook.courseTrack.name }} {{ printedBook.name }}
search Use offline Tools apps
Login account_circle menu_open

Writing Linear Functions


Linear Function

If a function has a constant rate of change, it is linear. Graphically, a linear function is a straight line.

Using that line, it's possible to determine the rate of change by finding the horizontal change (Δx)(\Delta x) and the vertical change (Δy)(\Delta y) between any two given points on the line. Any function whose graph is not a straight line cannot be linear.


The slope of a line passing through the points (x1,y1)(x_1,y_1) and (x2,y2)(x_2,y_2) is the ratio of the vertical change (Δy)(\Delta y) to the horizontal change (Δx)(\Delta x) between the points. The variable mm is most commonly used to represent slope.

m=ΔyΔxm=\dfrac{\Delta y}{\Delta x}

The words rise and run are sometimes used to describe the slope of a line, especially when the line is given graphically. Rise corresponds to Δy\Delta y and run corresponds to Δx.\Delta x.

This gives the following definition for the slope of a line.

m=ΔyΔx=riserunm=\dfrac{\Delta y}{\Delta x}=\dfrac{\text{rise}}{\text{run}}

Because the rate of change of a linear function is constant, any two points on the line can be used to find the slope – either algebraically with the slope formula or graphically as shown below.
The sign (positive or negative) of each distance corresponds to the direction of the movement between points. Moving to the right, the run is positive; moving to the left, the run is negative. Similarly, moving up yields a positive rise while moving down gives a negative rise.

Slope Formula

The slope of a line can be found algebraically using the following rule.


Here, (x1,y1)(x_1,y_1) and (x2,y2)(x_2,y_2) are two points on the line.

Slope-Intercept Form

One way to express linear function rules is called slope-intercept form.


Sometimes, f(x)=mx+bf(x)=mx+b is used. In either case, mm and bb describe the general characteristics of the line. mm indicates the slope, and bb indicates the yy-intercept. The linear function graphed below can be expressed as f(x)=2x+1, f(x)=2x+1, because it has a slope of 22 and a yy-intercept at (0,1).(0,1).


Write the equation of the line that passes through the points (3,1)(3,1) and (5,5).(5,5).

Show Solution
A line in slope-intercept form is given by the equation y=mx+b, y=mx+b, where mm is the slope of the line and bb is the yy-intercept. Since two points on the line are known we can use the slope formula to determine the slope.
m=y2y1x2x1m = \dfrac{y_2-y_1}{x_2-x_1}
m=5153m = \dfrac{{\color{#0000FF}{5}}-{\color{#009600}{1}}}{{\color{#0000FF}{5}}-{\color{#009600}{3}}}
The equation, y=mx+b,y=mx+b, can now be rewritten using the knowledge that the slope, m,m, is 2.2. y=2x+b y=2x+b The yy-intercept can now be found by replacing xx and yy in the equation with one of the points, for example (5,5),(5,5), and solve the resulting equation.
5=25+b{\color{#0000FF}{5}}=2\cdot {\color{#009600}{5}}+b
-5=b\text{-} 5=b
b=-5b=\text{-} 5
Thus, the equation of the line passing through the two points is y=2x5. y=2x-5.

Writing the Equation of a Line in Slope-Intercept Form from a Graph

To write the equation of the graph of a line in slope-intercept form, y=mx+b, y=mx+b,

the yy-intercept, bb, and the slope of the line, m,m, must be found. The following method can be used. As an example, consider the line shown.


Find the yy-intercept

The yy-intercept is the point where the graph intersects the yy-axis. From the diagram, it can be seen that the yy-intercept is (0,-4).(0,\text{-} 4).


Replace bb with the yy-intercept

The yy-coordinate of the yy-intercept can be substituted into y=mx+by=mx+b for b.b. Here, substituting b=-4b=\text{-} 4 gives y=mx4. y=mx-4.


Find the slope

Next, the slope of the line must be determined. From a graph, the slope of a line can be expressed as m=riserun, m=\dfrac{\text{rise}}{\text{run}}, where rise gives the vertical distance between two points, and run gives the horizontal distance. To find the slope, use any two points. Here, use the already marked yy-intercept and the arbitratily chosen (2,2).(2,2).

From the lines drawn, it can be seen that the rise=6\text{rise}=6 and the run=2.\text{run}=2. Therefore, the slope is m=62=3. m=\dfrac{6}{2}=3.


Replace mm with the slope

The complete equation of the line can now be written by substituting the value of mm into the equation from Step 2. Here, substitute m=3.m=3. y=3x4. y=3x-4.

{{ 'mldesktop-placeholder-grade-tab' | message }}
{{ 'mldesktop-placeholder-grade' | message }} {{ article.displayTitle }}!
{{ grade.displayTitle }}
{{ exercise.headTitle }}
{{ 'ml-tooltip-premium-exercise' | message }}
{{ 'ml-tooltip-programming-exercise' | message }} {{ 'course' | message }} {{ exercise.course }}
{{ 'ml-heading-exercise' | message }} {{ focusmode.exercise.exerciseName }}
{{ 'ml-btn-previous-exercise' | message }} arrow_back {{ 'ml-btn-next-exercise' | message }} arrow_forward