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.

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 .
In this formula, and represent the variables, represents the slope, and represents the vertical intercept. To write the equation using this form, follow these steps:
- Identify the value where the line crosses the vertical axis and assign it to .
- Calculate the vertical change divided by the horizontal change between two points on the line and assign it to .
- Substitute the values of and into the formula .
For a line crossing the vertical axis at and decreasing by units for every unit moved to the right, the slope is and the intercept is . The completed equation is .
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 . Subtract the values in a consistent order to ensure the correct sign.

Once you have calculated , you can write a linear equation from points by substituting and the coordinates of one point into . This produces a single equation where only is unknown. Solving for 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 .
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 and decreases by vertical units for every horizontal unit it travels right. What is its equation?
Method:
- Identify the vertical intercept . The line crosses at , so .
- Identify the slope . Decreasing by units for every unit means .
- Substitute both values into the structure .
Answer: .
Check: Substitute into the equation. . This matches the given coordinate .
Example 2: Formulating an equation from coordinates
Question: Write the equation of the line that passes through the points and .
Method:
- Calculate the slope by dividing the change in vertical values by the change in horizontal values.
.
- Substitute the slope and one point, such as , into .
.
- Solve for .
, which means .
- Write the full equation using the discovered values for and .
Answer: .
Check: Test the second point . Does ? Yes, . The equation is correct.
Example 3: Constructing a contextual model
Question: A rental company charges a fixed booking fee of dollars and an additional dollars for every day a machine is rented. Write an equation for the total cost over days.
Method:
- Identify the starting value. The cost is dollars before any days pass, so .
- Identify the rate of change. The cost increases by dollars per day, so .
- Substitute these constants into the linear form.
Answer: .
Check: If the machine is rented for days, the cost should be dollars. Using the equation, . 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 , the result is , not .
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 and .
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 , where 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 . If your equation is correct, the resulting calculation will equal the known value.
What happens if the starting value is zero?
If a line crosses the vertical axis exactly at the origin , the value of is zero. The equation simplifies to .
Practice questions

Which linear equation correctly represents the graphed line?
A line has a constant rate of change of and passes through the point . What is the equation of the line?

Which equation models the data shown in the table?
When calculating the slope between and , a common mistake is subtracting the values incorrectly. Which calculation shows the correct method for finding the slope?
A plumber charges an initial call-out fee of dollars and dollars for every hour worked. Which equation shows the total cost for hours of work?
