Algebra • Linear Equations

Equation of a Line: Slope-Intercept Form

Explore the canonical linear equation y = mx + b. Compute slopes, vertical intercepts, and coordinate sampling tables, convert between standard algebraic formats, and visualize linear trajectories on an interactive 2D Cartesian plane.

|
Last Updated: September 2026
|
Verified Accurate: Analytic Geometry & Regression Theory
Slope-Intercept Form: y = mx + b
Set Slope (m) & y-Intercept (b)
Table of Values (x, y) Sampling Grid
x y = mx + b Coordinate (x, y)
Solved Linear Form Negative Slope
Slope-Intercept Form
y = -1.5x + 4
Standard Form (Ax + By = C)
3x + 2y = 8
Point-Slope at y-Intercept
y - 4 = -1.5(x - 0)
Slope (m)
-1.5
Inclination (θ)
123.69°
y-Intercept
(0, 4)
x-Intercept
(2.6667, 0)
Cartesian Plane & Slope Vector Auto-Scaled Grid
Line Intercepts
m = rise / run
Step-by-Step Algebraic Derivation
Direct Answer & Overview
Verified Educational Guide

Slope-Intercept Formula at a Glance

Slope-intercept form expresses a non-vertical straight line as an explicit single-valued function f(x) = mx + b. The parameter m specifies the slope (rise over run, Δy / Δx), determining the rate of change and inclination angle. The parameter b defines the y-intercept (0, b), representing the initial vertical elevation where the line intersects the vertical coordinate axis.

Primary Mathematical Formula Explicit Linear Function Model
Standard Equation
ƒ(x)
Q.E.D.
y=mx+by = mx + b
Slope m = Δy / Δx • Vertical Intercept at (0, b) • Unique for every non-vertical line
Exact Formula
Input Parameters
Required
1
Slope (m): The constant rate of change (vertical rise over horizontal run).
2
Y-Intercept (b): The vertical coordinate where the line crosses the y-axis.
Expected Outputs
Calculated
Slope-Intercept Equation: y = mx + b.
Standard Form Equation: Ax + By = C.
Intercept Coordinates: Y-intercept (0, b) and X-intercept (-b/m, 0).
Worked Numerical Example
Instant Verification
Find the equation with slope m = -2 and y-intercept b = 5
→ Step 1: Identify m = -2, b = 5. Step 2: Substitute into y = mx + b.
y = -2x + 5

Theoretical Framework of Slope-Intercept Form (y = mx + b)

In algebra and mathematical analysis, the slope-intercept form is universally recognized as the canonical representation of a non-vertical straight line in the two-dimensional Cartesian plane ℝ². For multi-form line conversions or two-point calculations, see our comprehensive Equation of a Line Calculator. Formulated with the dependent variable y isolated on the left-hand side, it defines an explicit mathematical function:

f(x) = mx + b   or   y = mx + b

This formulation decomposes the infinite geometric continuum of the straight line into two distinct, physically meaningful parameters:

  • The Slope (m): A real scalar quantifying the steepness, direction, and constant rate of change of y with respect to x. Defined as the ratio of vertical change (rise) to horizontal change (run), m = Δy / Δx. It measures how rapidly the dependent variable ascends or descends for every single unit increment along the horizontal axis.
  • The y-Intercept (b): The real scalar coordinate where the line intersects the vertical y-axis. Because every point on the vertical axis possesses an abscissa of x = 0, evaluating the function at zero yields f(0) = m(0) + b = b, confirming the intercept coordinate is exactly (0, b).

In mathematical modeling and experimental sciences, b represents the initial baseline condition, datum elevation, or fixed overhead value at time zero, while m represents the velocity, marginal cost, or gradient that scales linearly with the independent variable x.

Axiomatic Derivation from Fundamental Slope Definitions

The slope-intercept equation is derived directly from the fundamental definition of slope in Euclidean geometry.

Let L be a non-vertical straight line possessing constant slope m. By definition, L must intersect the vertical y-axis at some point P₀(0, b). Let P(x, y) represent any arbitrary variable point lying on L such that x ≠ 0.

Applying the Euclidean difference quotient for slope between points P₀(0, b) and P(x, y) gives:

m = (y - b) / (x - 0)

Simplifying the denominator:

m = (y - b) / x

To clear the fraction, we multiply both sides of the equality by the non-zero scalar x:

m \cdot x = y - b

Now, isolate the variable y by adding b to both sides of the equation:

y = mx + b

When x = 0, substituting into y = m(0) + b produces y = b, confirming that the equality holds universally across all real numbers x ∈ ℝ without singularity.

Geometric Anatomy: How m and b Alter the Line Manifold

Visualizing how the individual parameters m and b influence the orientation and placement of the line is critical for algebraic intuition.

Varying m (Rotational Dynamics)

Holding b constant while varying m creates a pencil of lines anchored at (0, b). As m increases positively from 0 to +∞, the line rotates counterclockwise toward the vertical. As m becomes negative, the line tilts downward from upper-left to lower-right. When m = 0, the line is perfectly horizontal (y = b).

Varying b (Translational Dynamics)

Holding m constant while varying b creates a family of parallel lines. Incrementing b translates the line vertically upward without changing its angle of inclination. Decrementing b translates the line downward. All lines in this family share identical slope m and never intersect.

The Rigorous Graphing Algorithm: Rise, Run, and Stepping

Slope-intercept form provides the most efficient algorithm for graphing a straight line by hand or implementing rendering loops in software. Rather than compiling an extensive table of arbitrary values, you can accurately construct the line using only two geometric steps:

The 3-Step Construction Procedure

  1. Step 1: Plot the Anchor Intercept (0, b)
    Locate the constant b along the vertical y-axis and plot the anchor coordinate (0, b). If b > 0, the point lies above the origin; if b < 0, it lies below the origin; if b = 0, it coincides with the origin (0, 0).
  2. Step 2: Decompose the Slope into Rise and Run
    Express the slope m as an explicit rational fraction m = Δy / Δx.
    • If m is an integer (e.g., 3), write it as 3 / 1 (rise = +3, run = +1).
    • If m is negative (e.g., -2/5), attach the negative sign to the numerator: -2 / 5 (rise = -2, meaning move down 2; run = +5, meaning move right 5).
  3. Step 3: Step to the Second Coordinate and Draw the Line
    Starting from (0, b), count vertically by Δy and horizontally to the right by Δx. Plot this second coordinate at (0 + Δx, b + Δy). Align a straightedge through both points and extend the line across the entire Cartesian plane with directional arrows.

Systematic Conversions: Standard, Point-Slope, and Intercept Forms

Mastery of Cartesian geometry requires fluid algebraic conversion between coordinate models. When converting between representations, the point-slope form y - y₁ = m(x - x₁) serves as the natural algebraic bridge, while lines with slope m = 0 simplify directly into horizontal lines y = k. To automate the algebraic redistribution and term-combining steps for complex linear expressions, use our Equation Simplifier.

Conversion Direction Starting Formula Algebraic Transition Formula
Standard Form to Slope-Intercept Ax + By = C y = (-A/B)x + (C/B)   [m = -A/B, b = C/B]
Point-Slope to Slope-Intercept y - y₁ = m(x - x₁) y = mx + (y₁ - m·x₁)   [b = y₁ - m·x₁]
Slope-Intercept to Standard Form y = mx + b -mx + y = b &implies; Ax + By = C   [Multiply by LCD]
Two-Intercept to Slope-Intercept x/a + y/b = 1 y = (-b/a)x + b   [m = -b/a, y-intercept = b]

Linear Operators, Polar Forms, and Statistical Regression

Beyond high-school algebra, the slope-intercept form serves as the gateway to functional analysis, linear transformations, and modern data science.

A. Affine Maps in Functional Analysis

Strictly speaking in linear algebra, a transformation T: V → W is defined as linear if and only if it satisfies additivity T(u + v) = T(u) + T(v) and homogeneity T(cu) = cT(u). Notice that when b ≠ 0, the function f(x) = mx + b violates homogeneity:

f(0) = m(0) + b = b ≠ 0   (when b ≠ 0)

Therefore, in rigorous mathematics, y = mx + b is classified as an affine transformation: the composition of a purely linear map x ↦ mx followed by a translation vector +b. Only when the line passes through the origin (b = 0) is the map strictly linear in the vector space sense.

B. Simple Linear Regression (Ordinary Least Squares)

In machine learning, statistics, and econometrics, fitting a slope-intercept line to observed bivariate empirical data (xi, yi) (for i = 1 to N) is the foundational task of linear regression:

y_predicted = β₁ · x + β₀

Under Ordinary Least Squares (OLS), the objective is to minimize the sum of squared vertical residuals ∑ (yi - y_predictedi)². The closed-form analytical solutions for the slope β₁ (m) and intercept β₀ (b) are given by:

m = Cov(X, Y) / Var(X),   b = y_mean - m · x_mean

This confirms that the centroid of the empirical data (x_mean, y_mean) always lies precisely on the fitted regression line.

C. Polar Coordinate Form of a Line

In polar coordinates (r, θ) where x = r·cos(θ) and y = r·sin(θ), substituting these relations directly into y = mx + b yields:

r \cdot \sin(\theta) = m \cdot r \cdot \cos(\theta) + b

Factoring the radial distance r from both variable terms produces:

r(\theta) = b / (\sin(\theta) - m \cdot \cos(\theta))

This polar equation defines the line for all angles where the denominator does not vanish (i.e., where tan(θ) ≠ m).

Comprehensive Step-by-Step Worked Examples

Review these practical examples illustrating step-by-step techniques for formulating and transforming slope-intercept equations.

Example 1: Direct Construction from m and b Fundamental

Problem: Write the slope-intercept equation of a line with slope m = -5/2 and y-intercept (0, 7).

Step 1: Identify m and b: m = -5/2, b = 7.

Step 2: Substitute directly into y = mx + b:

y = -5/2 x + 7 (or y = -2.5x + 7)

Step 3: Compute the corresponding x-intercept by setting y = 0:

0 = -2.5x + 7 ⟹ 2.5x = 7 ⟹ x = 7 / 2.5 = 2.8 ⟹ x-intercept is (2.8, 0)

Example 2: Constructing from Two Coordinates Two Points

Problem: Find the slope-intercept equation for the line passing through (-3, 11) and (2, -4).

Step 1: Calculate slope m:

m = (y₂ - y₁) / (x₂ - x₁) = (-4 - 11) / (2 - (-3)) = -15 / 5 = -3

Step 2: Substitute m = -3 and point (2, -4) into y = mx + b to solve for b:

-4 = (-3)(2) + b ⟹ -4 = -6 + b ⟹ b = -4 + 6 = 2

Slope-Intercept Form: y = -3x + 2

Example 3: Converting Standard Form Algebraic Conversion

Problem: Convert the standard form equation 4x - 6y = 18 into slope-intercept form and state the slope and intercepts.

Step 1: Subtract 4x from both sides:

-6y = -4x + 18

Step 2: Divide every term by -6:

y = (-4/-6)x + (18/-6)

y = (2/3)x - 3

Step 3: Identify geometric properties: Slope m = 2/3, y-intercept is (0, -3), and x-intercept is (4.5, 0).

Example 4: Parallel Line Passing Through a Point Parallelism

Problem: Find the equation of the line passing through (4, -5) that is parallel to y = -0.5x + 8.

Step 1: Identify slope of given line: m = -0.5. Parallel lines share identical slopes: m_parallel = -0.5.

Step 2: Substitute m = -0.5 and (4, -5) into y = mx + b:

-5 = -0.5(4) + b ⟹ -5 = -2 + b ⟹ b = -3

Equation: y = -0.5x - 3

Example 5: Perpendicular Line Passing Through a Point Orthogonality

Problem: Find the slope-intercept equation of the line perpendicular to y = 4x - 1 passing through (-8, 3).

Step 1: Given slope m₁ = 4. The perpendicular slope is the negative reciprocal: m₂ = -1/4 = -0.25.

Step 2: Substitute m₂ = -0.25 and (-8, 3) into y = mx + b:

3 = -0.25(-8) + b ⟹ 3 = 2 + b ⟹ b = 1

Equation: y = -0.25x + 1

Example 6: Horizontal Line as a Special Case Zero Slope

Problem: Write the slope-intercept form for a horizontal line crossing the y-axis at -6.

Step 1: A horizontal line has zero slope: m = 0.

Step 2: The y-intercept is b = -6.

Step 3: Substitute into y = mx + b: y = 0x - 6.

Simplified Equation: y = -6

Example 7: Intersection of Two Slope-Intercept Lines System Solving

Problem: Find the intersection coordinate of L₁: y = 3x - 5 and L₂: y = -2x + 10.

Step 1: Set the right-hand expressions equal to each other:

3x - 5 = -2x + 10

Step 2: Add 2x to both sides and add 5 to both sides:

5x = 15 ⟹ x = 3

Step 3: Back-substitute x = 3 into L₁ to find y:

y = 3(3) - 5 = 9 - 5 = 4

Intersection Point: (3, 4)

Example 8: Calculus Tangent Line to Exponential Curve Calculus Application

Problem: Determine the slope-intercept equation of the tangent line to the natural exponential function f(x) = eˣ at the point where x = 0.

Step 1: Find the y-coordinate of the point of tangency by evaluating f(0):

y₀ = f(0) = e⁰ = 1 ⟹ Point of tangency is (0, 1)

Step 2: Compute the derivative f'(x) to determine the instantaneous slope:

f'(x) = d/dx (eˣ) = eˣ

Step 3: Evaluate the derivative at x = 0 to obtain slope m:

m = f'(0) = e⁰ = 1

Step 4: Notice that the point of tangency (0, 1) is already on the vertical y-axis, meaning the y-intercept is b = 1:

Slope-Intercept Form: y = 1x + 1 ⟹ y = x + 1

Significance: This confirms the classic calculus inequality eˣ ≥ 1 + x for all real x.

Example 9: Economics Break-Even Linear Analysis Applied Economics

Problem: A manufacturing company incurs $12,000 in fixed monthly facility lease costs plus $45 in variable materials per unit produced. They sell each unit for $85. Formulate both cost and revenue in slope-intercept form and find the break-even volume.

Step 1: Formulate Cost Function C(x): Slope m_c = 45, y-intercept b_c = 12000:

C(x) = 45x + 12000

Step 2: Formulate Revenue Function R(x): Selling price is $85 per unit with zero fixed base:

R(x) = 85x + 0 ⟹ R(x) = 85x

Step 3: Set R(x) = C(x) to compute the break-even volume x:

85x = 45x + 12000 ⟹ 40x = 12000 ⟹ x = 300 units

Step 4: Break-even revenue: R(300) = 85(300) = $25,500.

Real-World Applications in Physics, Engineering, and Economics

Slope-intercept form provides the mathematical architecture for modeling constant rates across empirical sciences. To calculate coordinate intercepts directly from points or vectors, consult our Y-Intercept Calculator.

Physics: Kinematic Velocity & Displacement

Under uniform linear acceleration a, velocity is expressed as v(t) = at + v₀, where acceleration is the slope m = a and initial velocity is the y-intercept b = v₀. In constant velocity motion, position is x(t) = vt + x₀.

Economics: Linear Cost & Revenue Modeling

Total operational expenditure is structured as C(x) = mx + b, where b represents fixed capital investments (facilities, insurance) and m represents variable marginal cost per unit manufactured.

Thermodynamics: Temperature Scales

The conversion between Celsius and Fahrenheit temperature scales is a canonical slope-intercept relation: F = (9/5)C + 32, with slope m = 1.8 and freezing point y-intercept b = 32°F.

Chemical Kinetics: Zero-Order Reactions

In chemical reaction engineering, zero-order reactant degradation follows the rate equation [A] = -k·t + [A]₀, where k is the rate constant (negative slope) and [A]₀ is the initial molar concentration (y-intercept).

Diagnostic Error Matrix & Student Misconceptions

Review the common diagnostic errors below to avoid habitual missteps when manipulating slope-intercept equations.

Frequent Mistake Incorrect Procedure Correct Mathematical Action
Conflating y-intercept with x-intercept Plotting b = 4 on the horizontal x-axis at (4, 0). The intercept b is strictly the vertical y-intercept at coordinate (0, b). The x-intercept is (-b/m, 0).
Dropping the Negative Sign in Slope For y = 5 - 2x, stating slope m = 5 and b = -2. Slope is always the coefficient of x: rewrite as y = -2x + 5, so m = -2 and b = 5.
Assuming m = 0 Means No Equation Exists Claiming that y = 0x + 4 is not a valid line equation. Zero slope represents a perfectly valid horizontal line y = 4.
Attempting to Express Vertical Lines Writing x = 3 as y = (undefined)x + b. Vertical lines have undefined slope and cannot be written in slope-intercept form. They must be expressed as x = h.
Fact-Checked & Verified • Computational Accuracy Standards
Updated September 2026 • Editorial Policy
Authored By
Sanjay Samanta

Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.

Reviewed & Verified By
Academic Review Board

Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.

Found an error or have an improvement suggestion? Report a calculation issue

Frequently Asked Questions

What is slope-intercept form in algebra?
Slope-intercept form is the standard linear equation y = mx + b, where m represents the slope (constant rate of change or steepness) and b represents the y-intercept, which is the vertical coordinate where the line crosses the y-axis at (0, b).
How do you graph a line using slope-intercept form?
To graph y = mx + b, first plot the y-intercept (0, b) on the vertical y-axis. Next, express the slope m as a fraction (rise / run). Starting from (0, b), count vertically by the rise value and horizontally to the right by the run value to plot a second coordinate. Finally, use a straightedge to draw the line passing through both points.
What does it mean if b = 0 in y = mx + b?
When b = 0, the equation reduces to y = mx. This represents a direct proportional variation where the line passes directly through the origin (0, 0). The ratio y / x is constant and equal to m for every non-zero coordinate.
Can all straight lines be written in slope-intercept form?
No. All non-vertical straight lines can be expressed in slope-intercept form. However, vertical lines have an undefined slope (division by zero) and cannot be solved for y as a single-valued function. Vertical lines must be written in the coordinate form x = h.
How do you convert standard form Ax + By = C into slope-intercept form?
To convert Ax + By = C into slope-intercept form, isolate y: subtract Ax from both sides to obtain By = -Ax + C. Then divide every term by B (assuming B ≠ 0) to yield y = (-A/B)x + (C/B). Here, the slope is m = -A/B and the y-intercept is b = C/B.
What is the x-intercept of a line in slope-intercept form?
The x-intercept is the point where the line crosses the horizontal axis, found by setting y = 0. Solving 0 = mx + b for x yields mx = -b, giving x = -b / m (provided m ≠ 0). The x-intercept coordinate is (-b/m, 0).
How do you find the equation of a line parallel to y = mx + b?
Parallel lines share identical slopes. Any line parallel to y = m₁x + b₁ will have the equation y = m₁x + b₂, where b₂ is determined by substituting any known coordinate on the parallel line.
How does slope-intercept form relate to linear regression in statistics?
In statistics and machine learning, ordinary least squares (OLS) simple linear regression estimates the relationship between a dependent variable y and an explanatory variable x as ŷ = β₁x + β₀, where β₁ represents the regression slope (m) and β₀ represents the intercept (b).
How does slope-intercept form appear in polar coordinates (r, θ)?
In polar coordinates where x = r·cos(θ) and y = r·sin(θ), substituting into y = mx + b yields r·sin(θ) = m·r·cos(θ) + b. Factoring r gives r(sin(θ) - m·cos(θ)) = b, which solves to r = b / (sin(θ) - m·cos(θ)).
What happens to the graph of y = mx + b when only m changes versus when only b changes?
Varying m while holding b constant creates a pencil of lines that pivots and rotates around the fixed anchor point (0, b). Varying b while holding m constant translates the line vertically up or down, generating a family of mutually parallel lines.