Writing Equations of Linear Functions
Learning Outcomes
- Write the equation of a linear function given its graph
- Match linear functions with their graphs
- Find the x-intercept of a function given its equation
- Find the equations of vertical and horizontal lines
[latex]m=\frac{\text{rise}}{\text{run}}=\frac{4}{2}=2[/latex]
Substituting the slope and y-intercept into slope-intercept form of a line gives:[latex]y=2x+4[/latex]
How To: Given THE graph of A linear function, find the equation to describe the function.
- Identify the y-intercept from the graph.
- Choose two points to determine the slope.
- Substitute the y-intercept and slope into slope-intercept form of a line.
Example: Matching Linear Functions to Their Graphs
Match each equation of a linear function with one of the lines in the graph below.- [latex]f\left(x\right)=2x+3[/latex]
- [latex]g\left(x\right)=2x - 3[/latex]
- [latex]h\left(x\right)=-2x+3[/latex]
- [latex]j\left(x\right)=\frac{1}{2}x+3[/latex]
Answer: Analyze the information for each function.
- This function has a slope of 2 and a y-intercept of 3. It must pass through the point (0, 3) and slant upward from left to right. We can use two points to find the slope, or we can compare it with the other functions listed. Function g has the same slope, but a different y-intercept. Lines I and III have the same slant because they have the same slope. Line III does not pass through (0, 3) so f must be represented by line I.
- This function also has a slope of 2, but a y-intercept of –3. It must pass through the point (0, –3) and slant upward from left to right. It must be represented by line III.
- This function has a slope of –2 and a y-intercept of 3. This is the only function listed with a negative slope, so it must be represented by line IV because it slants downward from left to right.
- This function has a slope of [latex]\frac{1}{2}[/latex] and a y-intercept of 3. It must pass through the point (0, 3) and slant upward from left to right. Lines I and II pass through (0, 3), but the slope of j is less than the slope of f so the line for j must be flatter. This function is represented by Line II.
Finding the x-intercept of a Line
So far we have been finding the y-intercepts of functions: the point at which the graph of a function crosses the y-axis. A function may also have an x-intercept, which is the x-coordinate of the point where the graph of a function crosses the x-axis. In other words, it is the input value when the output value is zero. To find the x-intercept, set the function f(x) equal to zero and solve for the value of x. For example, consider the function shown:[latex]f\left(x\right)=3x - 6[/latex]
Set the function equal to 0 and solve for x.[latex]\begin{array}{l}0=3x - 6\hfill \\ 6=3x\hfill \\ 2=x\hfill \\ x=2\hfill \end{array}[/latex]
The graph of the function crosses the x-axis at the point (2, 0).Q & A
Do all linear functions have x-intercepts? No. However, linear functions of the form y = c, where c is a nonzero real number are the only examples of linear functions with no x-intercept. For example, y = 5 is a horizontal line 5 units above the x-axis. This function has no x-intercepts.A General Note: x-intercept
The x-intercept of a function is the value of x where f(x) = 0. It can be found by solving the equation 0 = mx + b.Example: Finding an x-intercept
Find the x-intercept of [latex]f\left(x\right)=\frac{1}{2}x - 3[/latex].Answer: Set the function equal to zero to solve for x.
[latex]\begin{array}{l}0=\frac{1}{2}x - 3\\ 3=\frac{1}{2}x\\ 6=x\\ x=6\end{array}[/latex]
The graph crosses the x-axis at the point (6, 0).Analysis of the Solution
A graph of the function is shown below. We can see that the x-intercept is (6, 0) as expected. The graph of the linear function [latex]f\left(x\right)=\frac{1}{2}x - 3[/latex].
Try It
Find the x-intercept of [latex]f\left(x\right)=\frac{1}{4}x - 4[/latex].Answer: [latex]\left(16,\text{ 0}\right)[/latex]
Describing Horizontal and Vertical Lines
There are two special cases of lines on a graph—horizontal and vertical lines. A horizontal line indicates a constant output or y-value. In the graph below, we see that the output has a value of 2 for every input value. The change in outputs between any two points is 0. In the slope formula, the numerator is 0, so the slope is 0. If we use m = 0 in the equation [latex]f\left(x\right)=mx+b[/latex], the equation simplifies to [latex]f\left(x\right)=b[/latex]. In other words, the value of the function is a constant. This graph represents the function [latex]f\left(x\right)=2[/latex]. A horizontal line representing the function [latex]f\left(x\right)=2[/latex].
A vertical line indicates a constant input or x-value. We can see that the input value for every point on the line is 2, but the output value varies. Because this input value is mapped to more than one output value, a vertical line does not represent a function. Notice that between any two points, the change in the input values is zero. In the slope formula, the denominator will be zero, so the slope of a vertical line is undefined.
Notice that a vertical line has an x-intercept but no y-intercept unless it’s the line x = 0. This graph represents the line x = 2.
The vertical line [latex]x=2[/latex] which does not represent a function.
A General Note: Horizontal and Vertical Lines
Lines can be horizontal or vertical. A horizontal line is a line defined by an equation of the form [latex]f\left(x\right)=b[/latex] where [latex]b[/latex] is a constant. A vertical line is a line defined by an equation of the form [latex]x=a[/latex] where [latex]a[/latex] is a constant.Example: Writing the Equation of a Horizontal Line
Write the equation of the line graphed below.Answer: For any x-value, the y-value is [latex]–4[/latex], so the equation is [latex]y=–4[/latex].
Example: Writing the Equation of a Vertical Line
Write the equation of the line graphed below.Answer: The constant x-value is 7, so the equation is [latex]x=7[/latex].
Try It
From the information given below, write the related equations. Then walk through the slides to experiment with slope changes.- Write the equation of the function passing through the points [latex](2,6)[/latex] and [latex](4,4)[/latex] in slope-intercept form.
- Write the equation of a function whose slope is 2 and passes through the point [latex](-1,0)[/latex]
- Write the equation of a function whose slope is undefined.
Licenses & Attributions
CC licensed content, Original
- Revision and Adaptation. Provided by: Lumen Learning License: CC BY: Attribution.
- Slope Interactive. Authored by: Lumen Learning. Located at: https://www.desmos.com/calculator/7ighwgcjyi. License: Public Domain: No Known Copyright.
CC licensed content, Shared previously
- Precalculus. Provided by: OpenStax Authored by: Jay Abramson, et al.. Located at: https://openstax.org/books/precalculus/pages/1-introduction-to-functions. License: CC BY: Attribution. License terms: Download For Free at : http://cnx.org/contents/[email protected]..
- College Algebra. Provided by: OpenStax Authored by: Abramson, Jay et al.. License: CC BY: Attribution. License terms: Download for free at http://cnx.org/contents/[email protected].
- Question ID 1440. Authored by: unknown, mb Lippman,David. License: CC BY: Attribution. License terms: IMathAS Community License CC-BY + GPL.
- Question ID 79757. Authored by: Lumen Learning. License: CC BY: Attribution. License terms: IMathAS Community License CC-BY + GPL.
- Question ID 15599. Authored by: Johns,Bryan. License: CC BY: Attribution. License terms: IMathAS Community License CC-BY + GPL.
- Question ID 114592. Authored by: Lumen Learning. License: CC BY: Attribution. License terms: IMathAS Community License CC-BY + GPL.