Mathematica -- Module 3 -- Final Project   				
by Cheryl Hobneck							Slopes
Illinois Valley Community College
815 N. Orlando Smith Ave.
Og.lesby, Il 61348
815-224-0506
Email hobneck@cliff.ivcc.edu

Purpose:

This lesson is designed to provide students with an understanding of slope and how the slope of a line effects the graph of a line.  The first part will begin with a line having a slope equal to 1 and, by using examples, will investigate what happens to the line as the slope increases and decreases.  The second part will show what happens when the slope is negative and the third part will focus on horizontal and vertical lines.

Definition of Slope

Slope is defined to be a measure of the steepness of a line. 
 
Remember -- Slope can be found from a graph of the line by comparing the vertical change to the horizontal change for any two points on the line.

More commonly this is written:  ((vertical change)/(horizontal change))  or  ((change in y)/(change in x))  or (((Subscript[y, 2 ]) -  (Subscript[y, 1]))/((Subscript[x, 2 ]) -  (Subscript[x, 1]))) or (rise/run)

Slope can also be found from the equation of the line by writing the equation in slope-intercept form, y = mx + b, where m is the slope and b is the y-intercept.

Lines with positive slopes

Let us first examine a line having a slope = 1 and see what happens to the line as we change the slope.

<< "Graphics`Colors`"

\(Clear[x]; 

    firstplot = 
      Plot[1  x, {x, \(-4\), 4}, 
PlotStyle -> {Red, Thickness[0.01]}, 
        AspectRatio -> 1, 
AxesLabel -> {"x", "y"}, 
        PlotRange -> {\(-4\), 4}]; \)

How would you describe the line?  How would you describe the steepness of this line?

Now consider what happens when the slope > 1. 
Consider the graphs of lines y = 3x in blue and y = 9x in orange below.

\(Clear[x]; 

    secondplot = 
      Plot[3  x, {x, \(-4\), 4}, 
PlotStyle -> {Blue, Thickness[0.01]}, 
        AspectRatio -> 1, 
AxesLabel -> {"x", "y"}, 
        PlotRange -> {\(-4\), 4}]; \)

\(Clear[x]; 

    thirdplot = 
      Plot[9  x, {x, \(-4\), 4}, 
PlotStyle -> {Orange, Thickness[0.01]}, 
        AspectRatio -> 1, 
AxesLabel -> {"x", "y"}, 
        PlotRange -> {\(-4\), 4}]; \)

As the slope increases, what happens to the lines?

Consider the vertical change and the horizontal change between any two points on the lines.  What is happening to the verical change and the horizontal change as the slope increases?

Now consider what happens when the slope gets close to zero. 
Consider the graphs of lines y = (1/2)x in purple and y = (1/20)x in green below.

\(Clear[x]; 

    fourthplot = 
      Plot[1/2  x, {x, \(-4\), 4}, 
PlotStyle -> {Purple, Thickness[0.01]}, 
        AspectRatio -> 1, 
AxesLabel -> {"x", "y"}, 
        PlotRange -> {\(-4\), 4}]; \)

\(Clear[x]; 

    fifthplot = 
      Plot[1/20  x, {x, \(-4\), 4}, 
PlotStyle -> {Green, Thickness[0.01]}, 
        AspectRatio -> 1, 
AxesLabel -> {"x", "y"}, 
        PlotRange -> {\(-4\), 4}]; \)

As the slope gets closer ot zero, what happens to the lines?

Again,  consider the vertical change and the horizontal change between any two points on the lines.  What is happening to the verical change and the horizontal change as the slope decreases? 

Now let us look at all of these on the same graph and then side by side.

Show[firstplot, secondplot, thirdplot, fourthplot, fifthplot];

Show[
      GraphicsArray[{thirdplot, secondplot, firstplot, fourthplot, 
          fifthplot}]];

From these examples, what conclusions can you come to about slopes of lines?

Lines with negative slopes

Let us first examine a line having a slope = -1 and see what happens to the line as we change the slope.

\(Clear[x]; 

    sixthplot = 
      Plot[\(-1\) x, {x, \(-4\), 4}, 

        PlotStyle -> {Maroon, Thickness[0.01]}, AspectRatio -> 1, 

        AxesLabel -> {"x", "y"}, PlotRange -> {\(-4\), 4}]; \)

How would you describe the slope of this line?  Compare it to the other lines graphed above. 

Consider the graphs of the lines y = -3x in light blue and y = -10x in pink.

\(Clear[x]; 

    seventhplot = 
      Plot[\(-3\) x, {x, \(-4\), 4}, 

        PlotStyle -> {LightBlue, Thickness[0.01]}, AspectRatio -> 1, 

        AxesLabel -> {"x", "y"}, PlotRange -> {\(-4\), 4}]; \)

\(Clear[x]; 

    eighthplot = 
      Plot[\(-10\) x, {x, \(-4\), 4}, 
PlotStyle -> {Pink, Thickness[0.01]}, 
        AspectRatio -> 1, 
AxesLabel -> {"x", "y"}, 
        PlotRange -> {\(-4\), 4}]; \)

\(TextForm
    \`\(What\ can\ you\ say\ about\ lines\ with\ slopes\  < \ 
        \(-1?
			
Consider\)\ the\ graphs\ of\ y\  = \ 
      \(\(\(-1\)\/2\) x\ \ in\ gold\ \ and\ y\  = \ 
        \(\(-1\)\/10\) x\ \ in\ lime\ green . \ \ What\ do\ you\ think\ will\ 
          happen\ to\ these\ \(lines?\)\)		\)\)

\(Clear[x]; 

    ninthplot = 
      Plot[\(-1\)/2  x, {x, \(-4\), 4}, 

        PlotStyle -> {Gold, Thickness[0.01]}, AspectRatio -> 1, 

        AxesLabel -> {"x", "y"}, PlotRange -> {\(-4\), 4}]; \)

\(Clear[x]; 

    tenthplot = 
      Plot[\(-1\)/10  x, {x, \(-4\), 4}, 

        PlotStyle -> {LimeGreen, Thickness[0.01]}, AspectRatio -> 1, 

        AxesLabel -> {"x", "y"}, PlotRange -> {\(-4\), 4}]; \)

As the slope gets closer ot zero, what happens to the lines?

Now let us look at all of these on the same graph and then side by side.

Show[sixthplot, seventhplot, eighthplot, ninthplot, tenthplot];

Show[
      GraphicsArray[{tenthplot, ninthplot, eighthplot, seventhplot, 
          sixthplot}]];

From these examples, what conclusions can you come to about the graphs of lines with negative slopes?  What happens to the line as the slope approaches zero?

Horizontal and Vertical Lines

From the previous examples, what would you expect the slope of a horizontal line to be?

Remember the equation of a horizontal line is of the form y = b, where b is any real number. Notice that x is missing from this equation.

Consider the line y = 3, which can be written as y = 0x + 3, on the graph below.

\(Clear[x]; 

    eleventhplot = 
      Plot[0  x + 3, {x, \(-4\), 4}, 

        PlotStyle -> {Yellow, Thickness[0.01]}, AspectRatio -> 1, 

        AxesLabel -> {"x", "y"}, PlotRange -> {\(-4\), 4}]; \)

Compare the vertical change to the horizontal change for any two points on this line.  What do you get?

Now consider a vertical line.
	Remember:  The equation of a vertical line is of the form x = c, where c is any real number. Notice that y is missing from this equation.
Let us consider a vertical line with the equation x = 3.  
To graph this line you might want to rewrite the equation as x + 0y  = 3.  This would allow you to generate ordered pairs such as ( 3 , 2 ) , ( 3 , 5 ) , ( 3 , -2 ).  If you graph these ordered pairs, you will get a vertical line.

Using the formula that was mentioned earlier to find slope,

(((Subscript[y, 2])  -  (Subscript[y, 1]))/((Subscript[x, 2])  - (Subscript[x, 1]))) = ((5  -  2)/(3  -  3)) = (3/0)  you will find a vertical change of 3 and a horizontal change of zero.
This means that the slope of a vertical line is undefined.

Graphing a vertical line in this program presents a problem since it is not a function. 
	Remember: A set of ordered pairs is a function if for every x value there is one and only one y value.  This means that the x value cannot repeat in a function.

Summary

In the above lesson you have discovered what happens to lines as the slope changes from positive values to negative values.  Hopefully, by understanding the nature of slope, graphing lines will become easier.

Clear[x, m, f]\(f[x_] := m*x
\)Table[
      Plot[{f[x]}, {x, -4, 4}, PlotStyle -> Maroon, 
        AspectRatio -> 1, AxesLabel -> {"x", "y"}, 
        PlotRange -> {-4, 4}], {m, -10, 10, 1}];