Writing Linear Equations: Definition, Method and Examples

MathPublished

Writing Linear Equations: Method and Examples

To begin writing linear equations, find the constant rate of change and one point or intercept. Next, choose an appropriate mathematical form, substitute the known values to determine any missing constants, and check the resulting equation with another point or the original context.

What does writing a linear equation mean?

Writing a linear equation means creating a mathematical rule that describes a straight-line relationship between two variables. This rule allows you to predict the value of one variable when you know the value of the other.


Every point that makes the equation true sits on the same straight line. Creating this rule requires identifying the foundational properties of linear equations, which are the line's steepness and its starting position.


The most common way to write the equation of a line is using the slope-intercept form.

Slope-intercept form requires the constant rate of change and the starting value.


Once the equation is written, it serves as a universal model for that specific line, representing infinitely many coordinate pairs.

Find slope and an intercept

To write the equation, you need two distinct pieces of information: the slope of a line and its intercept.


The slope measures the constant rate of change. It describes how much the vertical value changes for every unit of horizontal change. This is often calculated as the vertical rise divided by the horizontal run between any two points.


The intercept typically refers to the vertical intercept, which is the point where the line crosses the vertical axis. This represents the starting value of the relationship when the horizontal input is zero.

A coordinate plane showing a line passing through the vertical axis at positive 1, with a slope triangle showing a rise of 2 units for every run of 1 unit.

Identifying these two values from a visual representation is a direct way to build a linear equation from a graph.

Write y equals mx plus b

The standard format used for graphing linear equations is y=mx+by = mx + b.

In this formula, yy and xx represent the variables, mm represents the slope, and bb represents the vertical intercept. To write the equation using this form, follow these steps:

  1. Identify the value where the line crosses the vertical axis and assign it to bb.
  2. Calculate the vertical change divided by the horizontal change between two points on the line and assign it to mm.
  3. Substitute the values of mm and bb into the formula y=mx+by = mx + b.

For a line crossing the vertical axis at 44 and decreasing by 22 units for every 11 unit moved to the right, the slope is −2-2 and the intercept is 44. The completed equation is y=−2x+4y = -2x + 4.

Write an equation from two points

When you only know two points on a line, you must calculate the constant rate of change algebraically before finding the starting value.


The slope between two points is the difference in vertical values divided by the difference in horizontal values.


Use the mathematical formula m=y2−y1x2−x1m = \dfrac{y_2 - y_1}{x_2 - x_1}. Subtract the values in a consistent order to ensure the correct sign.

A coordinate plane showing a straight line passing through points negative 2 comma 1 and 4 comma 4, demonstrating the calculation of slope between them.

Once you have calculated mm, you can write a linear equation from points by substituting mm and the coordinates of one point into y=mx+by = mx + b. This produces a single equation where only bb is unknown. Solving for bb provides the final missing value.

Model a context with a linear equation

Real-world scenarios can often be modeled mathematically if they contain a constant rate and a fixed starting value.


In these situations, the initial condition acts as the vertical intercept, while the rate of change acts as the slope. A common example is calculating a total cost that includes a flat fee and an hourly rate.


If a situation involves a constant rate but no initial starting value, the vertical intercept is zero. This forms a direct variation equation, written simply as y=mxy = mx.

Worked examples

These examples demonstrate how to construct the equation of a line using different given conditions. By substituting values systematically, you can solve equation word problems and algebraic models reliably.


Example 1: Identifying values from an expression


Question: A line crosses the vertical axis at (0,−5)(0, -5) and decreases by 33 vertical units for every 11 horizontal unit it travels right. What is its equation?


Method:

  1. Identify the vertical intercept bb. The line crosses at −5-5, so b=−5b = -5.
  2. Identify the slope mm. Decreasing by 33 units for every 11 unit means m=−3m = -3.
  3. Substitute both values into the structure y=mx+by = mx + b.

Answer: y=−3x−5y = -3x - 5.


Check: Substitute x=0x = 0 into the equation. y=−3(0)−5=−5y = -3(0) - 5 = -5. This matches the given coordinate (0,−5)(0, -5).


Example 2: Formulating an equation from coordinates


Question: Write the equation of the line that passes through the points (2,7)(2, 7) and (5,13)(5, 13).


Method:

  1. Calculate the slope mm by dividing the change in vertical values by the change in horizontal values.

m=13−75−2=63=2m = \dfrac{13 - 7}{5 - 2} = \dfrac{6}{3} = 2.

  1. Substitute the slope and one point, such as (2,7)(2, 7), into y=mx+by = mx + b.

7=2(2)+b7 = 2(2) + b.

  1. Solve for bb.

7=4+b7 = 4 + b, which means b=3b = 3.

  1. Write the full equation using the discovered values for mm and bb.

Answer: y=2x+3y = 2x + 3.


Check: Test the second point (5,13)(5, 13). Does 13=2(5)+313 = 2(5) + 3? Yes, 13=10+313 = 10 + 3. The equation is correct.


Example 3: Constructing a contextual model


Question: A rental company charges a fixed booking fee of 4040 dollars and an additional 1515 dollars for every day a machine is rented. Write an equation for the total cost yy over xx days.


Method:

  1. Identify the starting value. The cost is 4040 dollars before any days pass, so b=40b = 40.
  2. Identify the rate of change. The cost increases by 1515 dollars per day, so m=15m = 15.
  3. Substitute these constants into the linear form.

Answer: y=15x+40y = 15x + 40.


Check: If the machine is rented for 22 days, the cost should be 40+15+15=7040 + 15 + 15 = 70 dollars. Using the equation, y=15(2)+40=30+40=70y = 15(2) + 40 = 30 + 40 = 70. The model works.

Common mistakes

When creating equations, learners frequently place the variables in the wrong order. Remember that the vertical change is always divided by the horizontal change. Dividing horizontal by vertical calculates the reciprocal of the correct slope.


Another frequent error occurs when working with negative coordinates. Subtracting a negative number is equivalent to adding a positive number. If calculating the slope involves 5−(−3)5 - (-3), the result is 88, not 22.


Finally, do not leave the equation incomplete. After finding the slope, many people forget to solve for the vertical intercept or forget to rewrite the final equation containing both mm and bb.

Frequently asked questions

Does every linear equation have a vertical intercept?

Almost all lines have a vertical intercept. The only exception is a perfectly vertical line, which runs parallel to the vertical axis and never crosses it. The equation for a vertical line takes the special form x=cx = c, where cc is a constant.


How do I check if my linear equation is correct?

The most reliable way to verify your work is to take a set of coordinates known to be on the line and substitute the horizontal value in for xx. If your equation is correct, the resulting calculation will equal the known yy value.


What happens if the starting value is zero?

If a line crosses the vertical axis exactly at the origin (0,0)(0, 0), the value of bb is zero. The equation simplifies to y=mxy = mx.

Practice questions

Question

A coordinate plane showing a straight line crossing the vertical axis at positive 3 and passing through the point 2 comma 2.

Which linear equation correctly represents the graphed line?

  • y=−12x+3y = -\dfrac{1}{2}x + 3

  • y=−2x+3y = -2x + 3

  • y=12x+3y = \dfrac{1}{2}x + 3

  • y=−12x+2y = -\dfrac{1}{2}x + 2

Answer:

y=−12x+3y = -\dfrac{1}{2}x + 3

Question

A line has a constant rate of change of 44 and passes through the point (2,11)(2, 11). What is the equation of the line?

  • y=4x+11y = 4x + 11

  • y=4x−3y = 4x - 3

  • y=4x+3y = 4x + 3

  • y=2x+4y = 2x + 4

Answer:

y=4x+3y = 4x + 3

Question

A function table with two columns labeled x and y. The rows contain the paired values 0 and 5, 2 and 9, and 4 and 13.

Which equation models the data shown in the table?

  • y=4x+5y = 4x + 5

  • y=2x+5y = 2x + 5

  • y=5x+2y = 5x + 2

  • y=12x+5y = \dfrac{1}{2}x + 5

Answer:

y=2x+5y = 2x + 5

Question

When calculating the slope between (−3,4)(-3, 4) and (1,12)(1, 12), a common mistake is subtracting the values incorrectly. Which calculation shows the correct method for finding the slope?

  • 12−41−(−3)\dfrac{12 - 4}{1 - (-3)}

  • 1−(−3)12−4\dfrac{1 - (-3)}{12 - 4}

  • 12−41−3\dfrac{12 - 4}{1 - 3}

  • 12−14−(−3)\dfrac{12 - 1}{4 - (-3)}

Answer:

12−41−(−3)\dfrac{12 - 4}{1 - (-3)}

Question

A plumber charges an initial call-out fee of 6060 dollars and 4545 dollars for every hour worked. Which equation shows the total cost yy for xx hours of work?

  • y=60x+45y = 60x + 45

  • y=45x+60y = 45x + 60

  • y=105xy = 105x

  • y=45xy = 45x

Answer:

y=45x+60y = 45x + 60