y = mx + b Calculator
A line passes through the points (2, 5) and (6, 13). What is its equation? If you stared at that on a test and froze, you are not alone – finding the slope-intercept form under pressure trips up students and professionals alike. The y = mx + b calculator above removes the guesswork: enter what you know (two points, or a slope with a point, or m and b directly), and it returns the full equation, step by step.
What Is y = mx + b?
y = mx + b is the slope-intercept form of a linear equation in two variables. Each symbol has a specific geometric meaning:
| Symbol | Name | Meaning |
|---|---|---|
| m | Slope | Rise over run; how much y changes when x increases by 1 |
| b | y-intercept | The y-value where the line crosses the y-axis (x = 0) |
| x | Independent variable | Input value you choose |
| y | Dependent variable | Output the equation produces |
A line with m = 3 and b = −4 has the equation y = 3x − 4. Every point on that line – (0, −4), (1, −1), (2, 2) – satisfies the equation exactly.
How to Find m and b from Two Points
Given two points (x₁, y₁) and (x₂, y₂), the calculation has two steps.
Step 1 – Calculate the slope:
m = (y₂ − y₁) / (x₂ − x₁)
Step 2 – Calculate the y-intercept:
Substitute either point and the slope into y = mx + b, then solve for b:
b = y₁ − m · x₁
Worked example
Points: (2, 5) and (6, 13).
- m = (13 − 5) / (6 − 2) = 8 / 4 = 2
- b = 5 − 2 · 2 = 5 − 4 = 1
Equation: y = 2x + 1
The calculator above performs both steps instantly and shows the intermediate values.
How to Convert Other Forms to y = mx + b
Linear equations show up in several formats. Here is how each converts to slope-intercept form.
From standard form (Ax + By = C)
- Subtract Ax from both sides: By = −Ax + C
- Divide every term by B: y = (−A/B)x + (C/B)
- Read off m = −A/B, b = C/B
Example: 3x + 4y = 12 → y = (−3/4)x + 3, so m = −0.75 and b = 3.
From point-slope form (y − y₁ = m(x − x₁))
- Distribute m: y − y₁ = mx − mx₁
- Add y₁ to both sides: y = mx − mx₁ + y₁
- Combine constants: b = y₁ − mx₁
This is algebraically identical to the two-point method – it just starts from a known slope instead of computing one.
From two intercepts
If the line crosses the x-axis at (a, 0) and the y-axis at (0, b):
- m = (b − 0) / (0 − a) = −b / a
- The equation is y = (−b/a)x + b
When Does y = mx + b Not Apply?
The slope-intercept form requires a defined, finite slope. Two situations break this:
- Vertical lines (x = c): the denominator x₂ − x₁ equals 0, making the slope undefined. There is no y = mx + b representation.
- Horizontal lines (y = c): these do fit the form with m = 0 and b = c, giving y = 0x + c, or simply y = c.
Practical Uses of y = mx + b
The slope-intercept form is not just a textbook exercise. It models real-world relationships where a quantity changes at a constant rate.
| Application | What m represents | What b represents |
|---|---|---|
| Hourly wages | Pay rate per hour | Base pay or signing bonus |
| Phone bill | Cost per minute | Monthly fixed fee |
| Depreciation | Annual value loss | Original asset value |
| Distance over time | Speed | Starting position |
| Temperature conversion (°C to °F) | 9/5 | 32 (freezing point offset) |
For instance, the conversion °F = (9/5)·°C + 32 is a y = mx + b equation with m = 1.8 and b = 32.
Common Mistakes to Avoid
- Swapping the slope formula. Using (x₂ − x₁)/(y₂ − y₁) or (y₁ − y₂)/(x₂ − x₁) produces the wrong sign or an inverted value. Always (y₂ − y₁) over (x₂ − x₁).
- Forgetting to solve for b. Finding m is only half the task. Without b, you do not have the equation of the line.
- Mixing up x and y when substituting. Plugging x₁ into y₁’s spot gives an incorrect b. Double-check that the coordinates stay paired.
- Dividing incorrectly in standard-form conversion. Every term – including the constant – must be divided by B.
Quick Reference: Slope and y-Intercept at a Glance
| Scenario | m | b |
|---|---|---|
| Line rises left to right | Positive | Any value |
| Line falls left to right | Negative | Any value |
| Horizontal line | 0 | The constant y-value |
| Vertical line | Undefined | Does not exist |
| Parallel lines | Same m | Different b |
| Perpendicular lines | m₁ · m₂ = −1 | Any values |
This calculator provides mathematical results only. For financial, scientific, or engineering decisions, verify results against applicable standards and professional guidelines.
Frequently Asked Questions
What does each variable in y = mx + b represent?
Can a linear equation have no y-intercept?
How do I find the equation from one point and the slope?
What if the slope between two points is undefined?
How do I convert Ax + By = C to slope-intercept form?
See also
- Slope Formula: Find Slope Between Two Points
- Composite Function Calculator – f(g(x)) Solver
- Discriminant Calculator | Solve Quadratic Equations Instantly
- Linear Equation Calculator
- Radical Calculator – Simplify and Compute Roots Instantly
- Polynomial Calculator: Evaluate, Solve & Simplify Polynomials Online