y = mx + c: Definition Formula and Examples

#Y = Mx + C
TL;DR
y = mx + c describes every straight line that is not vertical: m is the gradient and c is the y-intercept. Six worked examples follow.
Shikha Sharma·reviewed byMadhukar VLast updated on December 2, 202613 min read

Key Points

  • In y=mx+cy = mx + c, mm is the gradient (the climb for each step right) and cc is the y-intercept, the point (0,c)(0, c).
  • The equation works because a straight line has the same gradient everywhere, a fact that rests on similar triangles.
  • Parallel lines share the same mm; perpendicular gradients multiply to −1-1.
  • y=mx+cy = mx + c and y=mx+by = mx + b are the same equation; only the intercept letter changes.

The Same Line, Written Two Different Ways Across an Ocean

A student in London and a student in New York write the same line with different letters.

  • In London it is y=mx+cy = mx + c; in New York it is y=mx+by = mx + b.
  • Same graph, same gradient, same crossing point on the vertical axis. Only one letter changed.
  • That letter trips up more learners than the mathematics does, so this page clears it up early.

What Is y = mx + c?

y = mx + c is the equation of a straight line in gradient-intercept form, where mm is the gradient and cc is the y-intercept.

  • The gradient mm measures steepness: the change in yy for each step of 11 in xx, or rise over run. Positive climbs, negative falls.
  • The intercept cc is the value of yy when x=0x = 0. Put x=0x = 0 in and only cc is left, so the line passes through (0,c)(0, c).
  • For one line, mm and cc are fixed while xx and yy change along it. In y=2x+1y = 2x + 1, the pair (3,7)(3, 7) fits and (3,6)(3, 6) does not.
y = mx + c drawn as a start at c and a climb of m for every step right
The line y = 2x + 1 on a grid, starting at the orange point (0, 1) on the y-axis and climbing 2 for each step of 1 to the right, through (1, 3), (2, 5) and (3, 7).

List y=2x+1y = 2x + 1 for x=0,1,2,3x = 0, 1, 2, 3 and you get 1,3,5,71, 3, 5, 7: start at cc, add mm each step. Two numbers rebuild the whole line.

Why y = mx + c Works: Two Ways to See It

The equation is not handed down; it falls out of what gradient means.

Way 1: similar triangles keep the gradient fixed

Draw a small step triangle under the line (across, then up) and a bigger one elsewhere.

  • Both triangles have the same angles, because the line meets every horizontal at the same angle.
  • So they are similar triangles, and rise ÷ run is the same for both. That number is mm.
similar step triangles on a line give the same gradient, which leads to y = mx + c
The line through (0, 1) with gradient three quarters, with a small step triangle of run 4 and rise 3 inside a larger one of run 8 and rise 6, so 3 divided by 4 equals 6 divided by 8, and the derivation of y = mx + c beside it.

Way 2: build the equation from the gradient

Take (0,c)(0, c) and any other point (x,y)(x, y) on the line. The gradient between them must be mm:

m=y−cx−0m = \frac{y - c}{x - 0}

Multiply both sides by xx, then add cc:

mx=y−c⟹y=mx+cmx = y - c \quad\Longrightarrow\quad y = mx + c

When the form breaks: vertical lines

A vertical line such as x=3x = 3 has a run of 00, so rise ÷ run has no value and there is no mm. It is written x=kx = k instead. A horizontal line is fine: its gradient is 00, so it is y=cy = c.

What m and c Do to the Graph

Change mm and the line turns about (0,c)(0, c); change cc and it slides up or down without turning.

changing m tilts the line while changing c slides it up or down
Two panels. Left: y = 2x + 1, y = half x + 1 and y = minus x + 1 all pass through (0, 1) at different tilts. Right: y = x + 3, y = x and y = x minus 2 are parallel and cross the y-axis at 3, 0 and minus 2.
  • The size of mm sets steepness: m=2m = 2 is steeper than m=12m = \frac{1}{2}.
  • If c=0c = 0 the line passes through the origin, y=mxy = mx: yy is in direct proportion to xx.
  • The x-intercept follows from both: 0=mx+c0 = mx + c gives x=−cmx = -\frac{c}{m}.

Parallel and Perpendicular Lines in y = mx + c

Parallel lines have the same gradient and different intercepts; perpendicular lines have gradients that multiply to −1-1.

  • y=12x−4y = \frac{1}{2}x - 4 and y=12x+7y = \frac{1}{2}x + 7 share mm, so they never meet.
  • Why −1-1? Turn the step "across 11, up mm" through 90°90° and it becomes "back mm, up 11", a gradient of −1m-\frac{1}{m}.
  • Flip the fraction and change the sign: 22 becomes −12-\frac{1}{2}. The rule cannot handle a vertical and a horizontal line, though they are perpendicular.
perpendicular gradients 2 and minus a half multiply to minus 1
The blue line y = 2x + 1 with its step triangle across 1 and up 2, and the orange line y = minus half x + 5 through (4, 3) with the same triangle turned 90 degrees, back 2 and up 1, meeting at a right angle.

Try It Yourself

The tool calls the gradient "slope". Drag the handles on each line, then try the presets: Parallel gives equal slopes, Perpendicular gives m1m2=−1m_1 m_2 = -1.

Y = mx + c and y = mx + b: The Same Equation

The intercept letter is a regional habit, not a different idea.

  • The UK, India and much of the Commonwealth write y=mx+cy = mx + c; the United States writes y=mx+by = mx + b.
  • In both, mm is the gradient (called slope in the US) and the last letter is the y-intercept.
  • Meet bb in a US book? Read it as "my cc" and carry on. See y = mx + b and slope-intercept form.
UK and India United States
Equation y=mx+cy = mx + c y=mx+by = mx + b
Steepness is called gradient, mm slope, mm
Intercept letter cc bb
The mathematics identical identical

How to Find the Equation of a Line

Every method has the same goal: find mm, then find cc.

  1. Given mm and cc: write them straight in.
  2. Given mm and a point: substitute the point and solve for cc.
  3. Given two points: find m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}, then use either point for cc.
  4. Given another form: rearrange until yy stands alone.
  5. Given a graph: read cc on the y-axis, then count rise over run.

Examples of y = mx + c

Example 1

Write the equation of the line with gradient 3 and y-intercept −5.

  1. Substitute m=3m = 3 and c=−5c = -5: y=3x+(−5)y = 3x + (-5).

Final answer: y=3x−5y = 3x - 5.

Example 2

Find the gradient and y-intercept of y = 7 − 2x. Predict first.

  1. The first instinct is to take the first number, m=7m = 7.
  2. Test: a gradient of 77 would make yy grow, but 7−2(1)=57 - 2(1) = 5 is smaller than 77.
  3. Reorder: y=−2x+7y = -2x + 7. mm multiplies xx; cc stands alone.

Final answer: gradient −2-2, y-intercept 77.

Example 3

Write 5x + 4y = 12 in the form y = mx + c.

  1. Subtract 5x5x: 4y=−5x+124y = -5x + 12.
  2. Divide every term by 44: y=−54x+3y = -\frac{5}{4}x + 3.
rearranging 5x + 4y = 12 gives gradient minus five quarters and intercept 3
The line 5x + 4y = 12 drawn through (0, 3) and (4, minus 2), with a step of across 4 and down 5, beside the rearranging steps that give y = minus five quarters x + 3.

Final answer: m=−54m = -\frac{5}{4} and c=3c = 3, not 1212.

Example 4

A line has gradient 3 and passes through (2, 7). Find its equation.

  1. Substitute: 7=3(2)+c7 = 3(2) + c.
  2. So c=1c = 1.

Final answer: y=3x+1y = 3x + 1.

Example 5

Find the equation of the line through (1, 5) and (3, 11).

  1. Gradient: m=11−53−1=62=3m = \frac{11 - 5}{3 - 1} = \frac{6}{2} = 3.
  2. Use (1,5)(1, 5): 5=3(1)+c5 = 3(1) + c, so c=2c = 2.
  3. Check (3,11)(3, 11): 3(3)+2=113(3) + 2 = 11.
the line through (1, 5) and (3, 11) is y = 3x + 2
The points (1, 5) and (3, 11) joined by a line with a run of 2 and a rise of 6, the line crossing the y-axis at c = 2, beside the steps m = 3, c = 2 and the check.

Final answer: y=3x+2y = 3x + 2.

Example 6

Find the line perpendicular to y = 2x + 1 through (4, 3).

  1. The perpendicular gradient is −12-\frac{1}{2}, since 2×(−12)=−12 \times \left(-\frac{1}{2}\right) = -1.
  2. Substitute: 3=−12(4)+c3 = -\frac{1}{2}(4) + c, so c=5c = 5.

Final answer: y=−12x+5y = -\frac{1}{2}x + 5, the orange line in the perpendicular figure.

Why This Form Matters: "Two Numbers Fix a Whole Line"

Any quantity that starts at a fixed value and changes at a steady rate is a straight line: cc is the start, mm the rate.

  • A burning candle. A 2020 cm candle losing 22 cm an hour has height h=−2t+20h = -2t + 20. It lasts until h=0h = 0, at t=10t = 10 hours.
  • Fares. A taxi charging a 3 pound flag-drop plus 2 pounds a mile is y=2x+3y = 2x + 3.
  • Conversions. F=95C+32F = \frac{9}{5}C + 32: the gradient is the exchange rate between the scales.
  • Trend lines. A line of best fit is quoted as y=mx+cy = mx + c so the rate and starting level read at once.
a candle burning down is modelled by a line with c = 20 and m = minus 2
A purple candle beside the graph of its height, h = minus 2t + 20, starting at 20 centimetres on the vertical axis, dropping 2 centimetres each hour and reaching 0 at t = 10 hours.

Turning lines into equations goes back to René Descartes's La Géométrie (1637) and to Pierre de Fermat's algebraic approach to geometry, worked out on his own. The straight line was the first case.

The Mistakes Students Make Most Often

Mistake 1: Swapping m and c

Where it slips in: Reading an equation in a hurry, or building one from a gradient and an intercept.

Don't do this: Read y=2x+3y = 2x + 3 as "gradient 33, intercept 22".

The correct way: mm sits with the xx; cc sits alone. y=2x+3y = 2x + 3 and y=3x+2y = 3x + 2 are different lines meeting only at (1,5)(1, 5). Checking x=0x = 0 catches the swap.

swapping m and c draws a different line
The blue line y = 2x + 3 and the orange line y = 3x + 2 crossing the y-axis at 3 and 2 and meeting only at (1, 5).

Mistake 2: Reading c before rearranging

Where it slips in: Equations such as 5x+4y=125x + 4y = 12, where yy is not alone.

Don't do this: Call 1212 the intercept and 55 the gradient.

The correct way: Rearrange to y=…y = \ldots, dividing every term by the number in front of yy, then read. Example 3 gave m=−54m = -\frac{5}{4}, c=3c = 3.

Mistake 3: Losing the sign of c

Where it slips in: Equations with a subtraction, such as y=4x−6y = 4x - 6.

Don't do this: Write c=6c = 6.

The correct way: y=4x+(−6)y = 4x + (-6), so c=−6c = -6 and the line crosses below the origin.

Mistake 4: Thinking c and b mean different things

Where it slips in: Switching between a UK or Indian book and a US one.

Don't do this: Treat y=mx+by = mx + b as a new formula to relearn.

The correct way: bb and cc are the same y-intercept; only the letter is regional.

Conclusion

  • y=mx+cy = mx + c fits every non-vertical line: mm is the gradient, cc the y-intercept (0,c)(0, c).
  • It works because similar triangles keep rise ÷ run the same along a line.
  • Read mm and cc only once yy is alone; equal gradients mean parallel, a product of −1-1 means perpendicular.
  • y=mx+cy = mx + c and y=mx+by = mx + b are the same equation in two notations.

A Practical Next Step

Practice these to solidify your understanding.

  1. State mm and cc for y=12x−4y = \frac{1}{2}x - 4.
  2. Write the line with gradient −3-3 through (0,6)(0, 6).
  3. Rearrange 3x−2y=83x - 2y = 8 into y=mx+cy = mx + c form.

Answer to Question 1: m=12m = \frac{1}{2}, c=−4c = -4.

Answer to Question 2: y=−3x+6y = -3x + 6.

Answer to Question 3: y=32x−4y = \frac{3}{2}x - 4. If the rearranging slips, go back to Example 3 and divide every term.

To take straight lines further with a teacher, explore Bhanzu's geometry tutor, high school math tutor or math classes online.

Want a live Bhanzu trainer to walk your child through gradients and straight-line graphs? Book a free demo class.

Read More

Research Behind This Article

  1. OpenStax, Elementary Algebra 2e, Section 4.5: Use the Slope-Intercept Form of an Equation of a Line (identifying m and b, parallel and perpendicular lines). openstax.org
  2. Abramson, J., College Algebra 2e, Section 4.1: Linear Functions, OpenStax, Rice University. openstax.org
  3. O'Connor, J. J. and Robertson, E. F., "René Descartes", MacTutor History of Mathematics, University of St Andrews. mathshistory.st-andrews.ac.uk
  4. O'Connor, J. J. and Robertson, E. F., "Pierre de Fermat", MacTutor History of Mathematics, University of St Andrews. mathshistory.st-andrews.ac.uk

Quick Quiz: Check Yourself

Three levels, questions with figures, instant feedback with the reason.

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What do m and c stand for in y mx c?
y mx c is how people often type y=mx+cy = mx + c: mm is the gradient and cc is the y-intercept, where the line crosses the y-axis.
Is y = mx + c the same as y = mx + b?
Yes. The UK and India use cc for the intercept; the United States uses bb.
Can every straight line be written in y = mx + c form?
Every line except a vertical one, which has no gradient and is written x=kx = k.
What is c when the line passes through the origin?
Zero, so the equation is simply y=mxy = mx.
How do you know if two lines are perpendicular from their equations?
Put both in y=mx+cy = mx + c form and multiply the gradients. A product of −1-1 means perpendicular.
✍️ Written By
Shikha Sharma
Shikha Sharma
Subject Matter Expert
Shikha Sharma is a Mathematics Subject Matter Expert at Bhanzu with over 7 years of experience in teaching and tutoring students across India. She specialises in foundational mathematics, with a strong understanding of how children in primary and middle school develop mathematical concepts. Her approach emphasises conceptual clarity and simplifying complex mathematical ideas into clear, manageable steps that make learning accessible and engaging for young learners. She brings expertise in mental mathematics, arithmetic, algebra, logical reasoning and problem-solving, with an emphasis on building strong mathematical foundations.
🔬 Reviewed By
Madhukar V
Math Columnist & Analyst
Book a FREE Demo ClassBook Now →