Introduction to Slope

Calculating the slope of a line

Lesson Overview

Instructor Presentation

Introduction

Slope is the degree that a line angles away from the horizontal.

One example would be the pitch of a roof.  A higher pitch means that there is a steeper angle to the roof, and a larger slope follows this same pattern, there is a steeper angle.

Goals

Students will be able to give the definition of slope in their own words.

Students will be able to calculate positive and negative slope based on a line and two points.  They will also have a general understanding of patterns as slope values change.

Concept Exploration

Examples of slope

This graph shows two lines and examples of higher and lower slope values.

Concept Exploration

Calculating the slope of a line.

Remember the phrase:  rise over run.

Choose any two points on the line, the slope equals the "rise" between the two points divided by the "run" between the two points.

This is represented by the formula (m stands for slope):

m = ((y2-y1)/(x2-x1))

Examples

Example 1

Let's work through some specific examples and calculate slope

Manipulate[
Last[{
If[answer==False,
Show[
Plot[m x+b, {x, -20, 20}, 
PlotRange->{-20, 20}, ImageSize->470,Ticks->None,
PlotLabel->Style[Row[{"m =",((y2-y1)/(x2-x1)), " = ?"}], Large]
],
Graphics[Line[{p, {First[p],m*First[p]+b}}]],
Graphics[{PointSize[Large],Point[{First[p],m*First[p]+b}]}],
Graphics[Line[{p, {First[x/.Solve[m*x+b==Last[p],x]],Last[p]}}]],
Graphics[{PointSize[Large],Point[{First[x/.Solve[m*x+b==Last[p],x]],Last[p]}]}],Graphics[Style[Text[Row[{"(",First[p],",",m*First[p]+b,")"}], {First[p]-4,m*First[p]+b+1}], Large]],
Graphics[Style[Text[Row[{"(",First[x/.Solve[m*x+b==Last[p],x]],",",Last[p]")"}], {First[x/.Solve[m*x+b==Last[p],x]]-4,Last[p]+1}], Large]]
],
Show[
Plot[m x+b, {x, -15, 15}, 
PlotRange->{-20, 20}, ImageSize->470,PlotLabel->Style[Row[{"m = ",
ToString[m*First[p]+b]<>If[Last[p]≥0, " - ", " + "] <>ToString[Abs[Last[p]]]/ToString[First[p]]<>If[First[x/.Solve[m*x+b==Last[p],x]]≥0, " - ", " + "]<>ToString[Abs[First[x/.Solve[m*x+b==Last[p],x]]]], " = ", m}], Large]
],
Graphics[Line[{p, {First[p],m*First[p]+b}}]],
Graphics[{PointSize[Large],Point[{First[p],m*First[p]+b}]}],
Graphics[Line[{p, {First[x/.Solve[m*x+b==Last[p],x]],Last[p]}}]],
Graphics[{PointSize[Large],Point[{First[x/.Solve[m*x+b==Last[p],x]],Last[p]}]}],
Graphics[Style[Text[Row[{"(",First[p],",",m*First[p]+b,")"}], {First[p]-4,m*First[p]+b+1}], Large]],
Graphics[Style[Text[Row[{"(",First[x/.Solve[m*x+b==Last[p],x]],",",Last[p]")"}], {First[x/.Solve[m*x+b==Last[p],x]]-4,Last[p]+1}], Large]]
]]
}],
{{p,{11.5,11.5}},Locator}, {{b,4}, -10, 10}, {{m, 1}, -4, 4}, {{answer, False}, {True, False}}
]

Use sliders above to demonstrate:

(1)  Move the "m" slider around a bit (and don't look at the value).  Practice substituting the x1, x2, y1, and y2 values to calculate slope for 3 examples.  Click on the "answer" button to check your answers.

(2)  Move the sliders such that b = 4 and m = 1.  Click to see the answer, and move the points on the graph with this mouse.  The slope is always 1 no matter where the two points are on the graph, why is that?

(3)  Change "m" to a negative value, why do you start to see addition signs in the equation?

(4)  Change the "b" value and notice the behavior of the line.  Should the slope change, why?

Examples

Example 2

Practice Problems, Basic (Integers).

Click the "Random Slope" button for a new problem, calculate the slope, then check your answer with the "answer" checkbox.  Work through examples until you can get 3 correct in a row.

Column[{
Button["Random Slope", m=RandomChoice[{-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8}], ImageSize->200],
Manipulate[
Last[{
If[answer==False,
Show[
Plot[m x+b, {x, -20, 20}, 
PlotRange->{-20, 20}, ImageSize->470,Ticks->None,
PlotLabel->Style[Row[{"m =",((y2-y1)/(x2-x1)), " = ?"}], Large]
],
Graphics[Line[{p, {First[p],m*First[p]+b}}]],
Graphics[{PointSize[Large],Point[{First[p],m*First[p]+b}]}],
Graphics[Line[{p, {First[x/.Solve[m*x+b==Last[p],x]],Last[p]}}]],
Graphics[{PointSize[Large],Point[{First[x/.Solve[m*x+b==Last[p],x]],Last[p]}]}],Graphics[Style[Text[Row[{"(",First[p],",",m*First[p]+b,")"}], {First[p]-4,m*First[p]+b+1}], Large]],
Graphics[Style[Text[Row[{"(",First[x/.Solve[m*x+b==Last[p],x]],",",Last[p]")"}], {First[x/.Solve[m*x+b==Last[p],x]]-4,Last[p]+1}], Large]]
],
Show[
Plot[m x+b, {x, -15, 15}, 
PlotRange->{-20, 20}, ImageSize->470,PlotLabel->Style[Row[{"m = ",
ToString[m*First[p]+b]<>If[Last[p]≥0, " - ", " + "] <>ToString[Abs[Last[p]]]/ToString[First[p]]<>If[First[x/.Solve[m*x+b==Last[p],x]]≥0, " - ", " + "]<>ToString[Abs[First[x/.Solve[m*x+b==Last[p],x]]]], " = ", m}], Large]
],
Graphics[Line[{p, {First[p],m*First[p]+b}}]],
Graphics[{PointSize[Large],Point[{First[p],m*First[p]+b}]}],
Graphics[Line[{p, {First[x/.Solve[m*x+b==Last[p],x]],Last[p]}}]],
Graphics[{PointSize[Large],Point[{First[x/.Solve[m*x+b==Last[p],x]],Last[p]}]}],
Graphics[Style[Text[Row[{"(",First[p],",",m*First[p]+b,")"}], {First[p]-4,m*First[p]+b+1}], Large]],
Graphics[Style[Text[Row[{"(",First[x/.Solve[m*x+b==Last[p],x]],",",Last[p]")"}], {First[x/.Solve[m*x+b==Last[p],x]]-4,Last[p]+1}], Large]]
]]
}],
{{p,{11.5,11.5}},Locator}, {{b,4}, -10, 10}, {{answer, False}, {True, False}}, Initialization:>(m=1)
]
}]

Examples

Example 3

Practice Problems, Advanced (non-Integers)

Click the "Random Slope" button for a new problem, calculate the slope, then check your answer with the "answer" checkbox.  Work through the examples until you can get 5 correct in a row.

Column[{
Button["Random Slope", m=RandomChoice[Flatten[Append[Table[i, {i,-5, -.1, .1}], Table[j, {j, .1, 5, .1}]]]], ImageSize->200],
Manipulate[
Last[{
If[answer==False,
Show[
Plot[m x+b, {x, -20, 20}, 
PlotRange->{-20, 20}, ImageSize->470,Ticks->None,
PlotLabel->Style[Row[{"m =",((y2-y1)/(x2-x1)), " = ?"}], Large]
],
Graphics[Line[{p, {First[p],m*First[p]+b}}]],
Graphics[{PointSize[Large],Point[{First[p],m*First[p]+b}]}],
Graphics[Line[{p, {First[x/.Solve[m*x+b==Last[p],x]],Last[p]}}]],
Graphics[{PointSize[Large],Point[{First[x/.Solve[m*x+b==Last[p],x]],Last[p]}]}],Graphics[Style[Text[Row[{"(",First[p],",",m*First[p]+b,")"}], {First[p]-4,m*First[p]+b+1}], Large]],
Graphics[Style[Text[Row[{"(",First[x/.Solve[m*x+b==Last[p],x]],",",Last[p]")"}], {First[x/.Solve[m*x+b==Last[p],x]]-4,Last[p]+1}], Large]]
],
Show[
Plot[m x+b, {x, -15, 15}, 
PlotRange->{-20, 20}, ImageSize->470,PlotLabel->Style[Row[{"m = ",
ToString[m*First[p]+b]<>If[Last[p]≥0, " - ", " + "] <>ToString[Abs[Last[p]]]/ToString[First[p]]<>If[First[x/.Solve[m*x+b==Last[p],x]]≥0, " - ", " + "]<>ToString[Abs[First[x/.Solve[m*x+b==Last[p],x]]]], " = ", m}], Large]
],
Graphics[Line[{p, {First[p],m*First[p]+b}}]],
Graphics[{PointSize[Large],Point[{First[p],m*First[p]+b}]}],
Graphics[Line[{p, {First[x/.Solve[m*x+b==Last[p],x]],Last[p]}}]],
Graphics[{PointSize[Large],Point[{First[x/.Solve[m*x+b==Last[p],x]],Last[p]}]}],
Graphics[Style[Text[Row[{"(",First[p],",",m*First[p]+b,")"}], {First[p]-4,m*First[p]+b+1}], Large]],
Graphics[Style[Text[Row[{"(",First[x/.Solve[m*x+b==Last[p],x]],",",Last[p]")"}], {First[x/.Solve[m*x+b==Last[p],x]]-4,Last[p]+1}], Large]]
]]
}],
{{p,{11.5,11.5}},Locator}, {{b,4}, -10, 10}, {{answer, False}, {True, False}}, Initialization:>(m=1)
]
}]

Examples Answer Key

Example 1

Use sliders above to demonstrate:

(1)  Move the "m" slider around a bit (and don't look at the value).  Practice substituting the x1, x2, y1, and y2 values to calculate slope for 3 examples.  Click on the "answer" button to check your answers.

Self-grading.

(2)  Move the sliders such that b = 4 and m = 1.  Click to see the answer, and move the points on the graph with this mouse.  The slope is always 1 no matter where the two points are on the graph, why is that?

The ratio of rise divided by run is the same, regardless of the two specific points you choose.  This is why you can choose any two points to calculate slope for a line.

(3)  Change m to a negative value, why do you start to see addition signs in the equation?

When you calculate y2 - y1 and y1 is negative, y2 - -y1 = y2 + y1.

(4)  Change the "b" value and notice the behavior of the line.  Should the slope change, why?

Although the line moves, it's angle is the same, so the slope is the same.  Precursor to y = m x + b form of equations.

Example 2

Self-grading.

Example 3

Self-grading.