Linear Function Definition, Equations, Graphs, Formula & Examples

Created by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process

Lesson Overview



Linear function in math explores relationships where a change in one quantity directly affects another at a constant rate. This consistent change is key. 

Examples include calculating fuel consumption based on distance traveled, determining phone bills with a fixed charge plus per-minute rate, and understanding simple interest growth.

What is a Linear Function?

Linear functions are algebraic functions because they use basic algebraic operations to define the relationship between x and y.

  • A linear function is represented as f(x) = mx + c, where m and c are constants.
  • It is similar to the slope-intercept form of a line, y = mx + c, and graphs as a straight line.
  • m is the slope, c is the y-intercept, x is the independent variable, and y (or f(x)) is the dependent variable.
  • For example, f(x) = 3x - 2 has a slope of 3 and a y-intercept of -2.

Linear Function Equation

The simplest linear function is f(x) = x, which represents a straight line passing through the origin. In general, a linear function equation is written as f(x) = mx + b, where 'm' is the slope and 'b' is the y-intercept. 

Here is an example of linear function

  • f(x) = 2x + 5
  • Here m is 2 and b is 5. So, the slope is 2.

Below are some examples of linear equations in one variable, two variables and three variables

Linear Equations in One VariableLinear Equations in Two VariablesLinear Equations in Three Variables
3x = 125x - 7 = 3
2(x + 1) = 10
y = 2x + 1
3x - 2y = 7
x/2 + y/3 = 1
2x + 3y - z = 5
x - y + 2z = 3
3x + 2y - z = 0


Real-Life Example of A Linear Function

Linear functions are commonly used to model relationships involving constant rates, such as cost, distance, or time. These equations help simplify decision-making in real-world scenarios.

  1. A food delivery service charges a flat fee of $3 and an additional $1.50 per mile for delivery. The total cost can be expressed as f(x) = 1.50x + 3, where x is the number of miles.
  2. A gym offers a membership plan with a $20 sign-up fee and $15 per month. The total cost is represented by the linear function f(x) = 15x + 20, where x is the number of months.

Linear functions are also used in optimization problems, such as minimizing costs or maximizing profits in business scenarios.

Graphs of Linear Functions

To draw a line, we only need two points. Once we have them, we can connect the points with a straight line and extend it in both directions. For the linear function f(x) = mx + b:

  • The line goes up when m > 0
  • The line goes down when m < 0
  • The line is flat when m = 0

A linear function can be graphed in two ways:

  • By finding two points on the line.
  • By using the slope and y-intercept.

Graphing a Linear Function by Finding Two Points

To find two points on a linear function f(x) = mx + b, choose any random values for x and substitute them into the function to calculate the corresponding y-values. Here's an example with the function f(x) = 3x + 5:

Step 1: Choose two random values for x.

Let x = -1 and x = 0.

Step 2: Substitute these x-values into the function to find the corresponding y-values.

  • When x = -1:

f(-1) = 3(-1) + 5 = -3 + 5 = 2

So, the point is (-1, 2).

  • When x = 0:

f(0) = 3(0) + 5 = 0 + 5 = 5

So, the point is (0, 5).

Step 3: Plot the points (-1, 2) and (0, 5) on the graph. Draw a straight line through them and extend it in both directions.

Graphing a Linear Function Using Slope and y-Intercept

To graph a linear function f(x) = mx + b, we can use its slope m and y-intercept b. Let's graph the function f(x) = 3x + 5. Here, the slope is m=3, and the y-intercept is (0,b)=(0,5).

Step 1: Plot the y-intercept (0,b).

In this case, plot the point (0,5).

Step 2: Write the slope as a fraction rise/run, and identify "rise" and "run."

Here, m=3=3/1=rise/run, so:

  • Rise = 3 (vertical change)
  • Run = 1 (horizontal change)

Step 3: Starting from the y-intercept, move vertically by the "rise" and horizontally by the "run" to find another point.

  • Since the "rise" is positive, move up 3 units.
  • Since the "run" is positive, move right 1 unit.

This gives the new point (1,8).

Step 4: Plot the points (0,5) and (1,8), connect them with a straight line, and extend the line in both directions.

Domain and Range of a Linear Function

The domain of a linear function is all real numbers (R), and the range is also all real numbers (R). Let's take two examples: f(x) = 2x + 3 and g(x) = 4 - x, both plotted on the same graph.

  • Both functions can take any value of x, so the domain is R. This can be seen by looking at the x-axis-there is a point on the graph for every x.
  • The output values of both functions range from -∞ to ∞, so the range is also R. This is shown along the y-axis, where there is a point on the graph for every y.

When the slope (m ≠ 0):

  • Domain = R
  • Range = R

Note:

  • The domain and range of a linear function are R unless specified otherwise.
  • If the slope m = 0, the linear function becomes f(x) = b, which is a horizontal line. In this case:
  • Domain = R
  • Range = {b}

Inverse of a Linear Function

The inverse of a linear function f(x) = ax + b is another function, written as f⁻¹(x), such that f(f⁻¹(x)) = f⁻¹(f(x)) = x. Let's find the inverse of the function f(x) = 3x + 5 using these steps:

Step 1: Replace f(x) with y.

The equation becomes y = 3x + 5.

Step 2: Swap x and y.

This gives x = 3y + 5.

Step 3: Solve for y.

x - 5 = 3y

y = (x - 5)/3

Step 4: Replace y with f⁻¹(x).

The inverse function is f⁻¹(x) = (x - 5)/3.

The Slope of A Linear Function

The slope of a linear function is a measure of its steepness or how much the function rises or falls as it moves along the x-axis. 

In the equation of a linear function y=mx+by = mx + by=mx+b, the slope is represented by mmm. It tells you how much the dependent variable yyy changes for a unit change in the independent variable xxx.

Types of Slopes:

  1. Positive slope (m > 0): The line rises as x increases.
  2. Negative slope (m < 0): The line falls as x increases.
  3. Zero slope (m = 0): The line is horizontal.
  4. Undefined slope: The line is vertical.

Example:

For the equation y = 3x + 2:

  • The slope m = 3.
  • This means that for every increase of 1 in x, y increases by 3.

For instance:

  • If x = 0, y = 2.
  • If x = 1, y = 5.
  • If x = 2, y = 8.

The graph of this equation will show a straight line with a slope of 3, rising upwards as x increases

Solved Examples Of Linear Functions

Example 1: Finding the Equation

  • Problem: A line passes through the points (2, 5) and (4, 11). Find its equation.

  • Solution:

  • Calculate the slope (m): m = (11 - 5) / (4 - 2) = 6 / 2 = 3
  • Use point-slope form with one point: y - 5 = 3(x - 2)
  • Simplify to slope-intercept form: y - 5 = 3x - 6 => y = 3x - 1

Example 2: Interpreting the Equation

  • Problem: A linear function is given by f(x) = -2x + 7. What is the slope and y-intercept?

  • Solution:

  • Compare with f(x) = mx + b: m = -2, b = 7
  • Interpret: The slope is -2 (line goes downwards), and the y-intercept is 7 (line crosses the y-axis at (0, 7)).

Example 3: Finding the X-intercept

  • Problem: Find the x-intercept of the line with the equation y = 4x - 12.

  • Solution:

  • Set y = 0: 0 = 4x - 12
  • Solve for x: 4x = 12 => x = 3
  • The x-intercept is (3, 0)

Example 4: Real-World Application

  • Problem: A plant is 10 cm tall and grows 2 cm each day. Write a linear function to model its height.

  • Solution:

  • Identify variables: Let 'h' be the height and 'd' the number of days.
  • Form the equation: h = 2d + 10 (initial height + growth per day)

Example 5: Parallel Lines

  • Problem: Find the equation of a line parallel to y = -x + 5 and passing through (1, 3).

  • Solution:

  • Parallel lines have the same slope: m = -1
  • Use point-slope form: y - 3 = -1(x - 1)
  • Simplify: y - 3 = -x + 1 => y = -x + 4


Rate this lesson:

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.