Skip to main content

How to Find Slope on Desmos

Graph lines and find slope from two points

By JasonPublished 5 min read

A student with a sled stands at the top of a long, even snowy slope.

Desmos has no slope button. To find the slope from two points, enter them in a table and type y_1 ~ mx_1 + b. Desmos reports m, the slope, and b, the y-intercept. If you have an equation, graph it and read the slope from the equation or from two points on the line. Try the steps in our Desmos calculator, then practice with Desmos Skills training.

Graph a line in Desmos

To make a straight line in Desmos, enter its equation in an expression line. For example:

  1. Type y = 2x + 3 and press Enter. Desmos draws a line.
  2. Read the equation as y=mx+b: the coefficient of x is the slope, so m=2. The constant 3 is the y-intercept.
  3. Select the line or its expression, then click its gray y-intercept to see the label (0,3).

A slope of 2 means that for each increase of 1 in x, y increases by 2. The line also passes through (1,5): move right 1 and up 2 from (0,3).

You can graph a line without solving for y first. Type 3x + 4y = 12 on a new expression line. Desmos draws the line directly. Select it and click its gray intercepts to label (4,0) and (0,3). The next section uses those points to find its slope.

Find slope from two points

Suppose the points are (1,8) and (3,4). Keep each x and y together in the same row. The first coordinate goes in the x1 column and the second in the y1 column.

  1. Click the plus button and choose Table.
  2. Enter 1 and 8 in the first row, then 3 and 4 in the second row.
  3. On a new expression line, type y_1 ~ mx_1 + b. Type the tilde ~ between the two sides. Use the subscript 1 from the table headers on both variables.
  4. Read the regression parameters: m=−2 and b=10. The slope is −2. The fitted line is y=−2x+10.
  5. Check that Desmos shows R2=1. That means the line passes through the points you entered.

The table's linear regression button is another route: it displays the fitted equation, so read the coefficient of x as the slope. Its fit statistics include R2, which is 1 for this exact fit. The typed tilde route displays m and b separately.

To check by calculation, type (4-8)/(3-1) on a new line. Desmos gives −2. This is the slope formula:

m=y2−y1x2−x1=4−83−1=−2

Subtract coordinates in the same order in the numerator and denominator. Reversing both points gives the same answer; reversing only one subtraction changes the sign. See SAT slope for more practice with rise over run.

Common mistake

Two points with the same x-coordinate make a vertical line. Its slope is undefined because the change in x is 0, and division by 0 is undefined. Use two points with different x-coordinates for a slope regression.

Find the slope from standard form

For 3x+4y=12, the slope is not written as a coefficient of x in y=mx+b form. Use the graph and a table:

  1. Type 3x + 4y = 12. Select the line, then click the two gray intercepts: (4,0) and (0,3).
  2. Click the plus button, choose Table, and enter (4,0) and (0,3) in separate rows.
  3. On a new line, type y_1 ~ mx_1 + b. Desmos reports m=−0.75 and b=3. The slope is −0.75, or −34. Check that R2=1.

Use exact point labels. Desmos rounds some coordinates on the graph, and a rounded point can give an inaccurate slope. If an intercept has a rounded label, select and drag along the line to find two points with exact terminating coordinates. Use those coordinates in the table. For a nonterminating slope, use the exact coordinates in the slope formula to write the exact fraction.

There is also an algebra shortcut. For Ax+By=C, with B≠0, the slope is −A/B. Here −A/B=−3/4. It works because subtracting Ax and dividing by B gives y=(−A/B)x+C/B. The SAT linear equations guide covers both forms.

Practice question · Lines and Linear Relationships

Show the Detailed Explanation

The equation is already in y=mx+b form. The coefficient of x is −45, so the slope is −45, choice A.

Parallel and perpendicular lines

Parallel lines have equal slopes. Graph y = 2x + 3 and y = 2x - 1: both slopes are 2, so the lines rise at the same rate and never intersect.

For two nonvertical perpendicular lines, flip the slope fraction and change its sign. A line perpendicular to one with slope 2=21 has slope −12. The two slopes multiply to −1: 2(−12)=−1. Graph y = -x/2 + 3 with y = 2x + 3 to see them intersect at a right angle. Keep the axes equally scaled so the angle looks right.

A horizontal line has slope 0. A vertical line has undefined slope, and the two are perpendicular. The product rule applies when both slopes are defined.

Practice question · Lines and Linear Relationships

Show the Detailed Explanation

A parallel line has the same slope, 3. Passing through the origin gives a y-intercept of 0, so its equation is y=3x, choice A.

What slope means in a word problem

Slope is a rate of change: change in y divided by change in x. Replace y and x with the units from the story to interpret the rate.

For example, let C=15+4t give a taxi fare C in dollars after t miles. The slope is 4 dollars per mile, so the fare increases by $4 for each mile. The $15 is the starting fare, not the rate. If the slope were negative, the output would decrease as the input increases.

Practice question · Meaning of Slope, Intercepts, or Points

Show the Detailed Explanation

Slope is change in dollars divided by change in cookies. The coefficient of n is 2, so the estimated cost increases by $2 for each additional cookie. The answer is 2, choice A.

Practice these readings in Meaning of Slope training, and practice equations in Lines and Linear Relationships.

Keep exploring Desmos

The regression guide explains fitting other models and checking their fit. For a set of plotted points, see how to connect points in Desmos. The guide to key Desmos features covers more calculator tools.

Finding slope on Desmos

  1. Graph an equation directly, or enter two points in a table and type y_1 ~ mx_1 + b.
  2. Read m as the slope and check that R2=1. Use exact point coordinates.
  3. For Ax+By=C, the slope is −A/B when B≠0.
  4. Parallel lines have equal slopes; defined perpendicular slopes multiply to −1.
  5. In a story, interpret slope as change in the output units per unit of the input.

Tutor? Use Resolve Prep with your students