Advanced Transformations of Graphs:

Stretching and Inverting Graphs

Lesson Overview

Instructor Presentation

Introduction

We have already learned how to transform graphs in the following ways:

Translating (shifting)

Reflections across axes.

Stretching

However, there are a multitude of other interesting operations that can be performed on initial functions.  Students will be able to accomplish the following tasks.

Goals

Students will be able to graph initial functions in Mathematica and those same functions with various stretches applied.

parameters={a,c,d,x}

Students will be able to graph initial functions and their inversions and predict what happens at "interesting" points.

Concept Exploration

Stretching Graphs - revisited

Plot the following two graphs on the same set of axes.

(1) f(x) = (1/(2(x^2)+2))

(2) g(x) = (1/((x^2)+1))

💡 Remember to graph on the same set of axes, make sure to "Plot" the list, using {  } around the graphs.  Mathematica will automatically color the graphs differently.  You can use PlotStyle to modify these, as I have.  
💡 I've "labeled" each graph below using the Mathematica function "Tooltip."  Move the mouse over each graph to see what happens.

Plot[{Tooltip[(1/(2(x^2)+2)),"(1/(2 (x^2) + 2))"],Tooltip[(1/((x^2)+1)),"(1/((x^2) + 1))"]},{x,-5,5},PlotRange->{-.5,1.5},PlotStyle->{{Thick,Blue},{Thick,Red}}]

What is the difference in the blue function and the red function?

g (x) = 2 f (x).  (The red function values are all twice the          corresponding blue function' s values.)

Example 1

For the following 2 sets of functions, first predict what the graph will look like, then plot the functions on the same set of axes.  For the plot, please make sure to...

Choose an appropriate window.  This is sometimes easier to determine after the plot is generated initially.

Make sure the two graphs are different colors of your choosing.  This is accomplished using the Plot Option "PlotStyle."

Make sure the lines are "Thick."

Add in your own Plot Option not already mentioned.

Also, in the box below the "Plot" box, record any observations that surprised you, or that you didn't expect would happen.

1)  (Piecewise[{{y = -(x^4)+2(x^3)+(x^2)-2x}, {y = 3(x^4)-6(x^3)-3(x^2)+6x}}])

Prediction :

Plot :

Surprises :

2)  (Piecewise[{{y = x-[[x]]}, {y = -2(x-[[x]])}}])

Prediction:

Plot:

Surprises:

Concept Exploration

Inverting Graphs

There is a definite graphical correlation between f(x) and (1/(f(x))).  Let's look at a couple of these with which we are familiar.

Plot[Sin[x],{x,-3π,3π},PlotRange->{-1.5,1.5},PlotStyle->Thick,Ticks->{Range[-4 π, 4 π, π], {-1,1}}]

The "interesting points" on this graph are...

x-intercepts

maximums and minimums

y-values of 1 or -1.

When we think about inverting an entire graph, we think about taking the reciprocal of each individual y-value.  We know that the reciprocal of sine is cosecant.

Xvalue={ -π, -π/2,0,π/4,π/2, π};
sine={0, -1, 0,((Sqrt[2])/2) ,1, 0};
cosecant={undefined, -1, undefined, (Sqrt[2]),1, undefined};

Join[{Xvalue},{sine},{cosecant}]

Now Transpose it.

Transpose[Join[{Xvalue},{sine},{cosecant}]]

Grid[Join[{{Style["Xvalue",FontFamily->"Arial",Bold],Style["sine",FontFamily->"Arial",Bold],Style["cosecant",FontFamily->"Arial",Bold]}},
Transpose[Join[{Xvalue},{sine},{cosecant}]]
],Dividers->{{2->True,3->True},2->True}]

TWO VERY HELPFUL TIPS TO GRAPHING FUNCTIONS AND THEIR RECIPROCALS:

When a graph is UNDEFINED, we find a VERTICAL ASYMPTOTE.

The reciprocal of 1 is 1, and the reciprocal of -1 is -1.

Plot[{Sin[x],Csc[x]},{x,-3π,3π},PlotStyle->{{Thick,Blue},{Thick,Red}},PlotRange->{-3,3},Ticks->{Range[-4 π, 4 π, π], Range[-3,3,0.5]}]

At places where sin(x) crosses the x-axis, the graph of csc(x) has a vertical asymptote.  At places where sin(x) = 1, csc(x) = 1 as well.

Example 2

Graph the following functions and their reciprocals.  Make a prediction about what will happen at certain "interesting points" before graphing.

Choose an appropriate window.  This is sometimes easier to determine after the plot is generated initially.

Make sure the two graphs are different colors of your choosing.  This is accomplished using the Plot Option "PlotStyle."

Make sure the lines are "Thick."

1)  y = x + 1

Prediction :

Plot :

2)  y = (x^2)-4

Prediction :

Plot:

Example 3

Inverting Graphs - more

Let's look at the last example from the last slide.

Plot[{(x^2)-4,(1/((x^2)-4))},{x,-4,4},AspectRatio->Automatic,PlotRange->{-4,4},PlotStyle->{{Thick, Yellow},{Thick,Orange}}]

What happens as certain parameters change?  Let's explore this below.  Move the slider in the demonstration and answer the questions below.

Manipulate[Plot[{(x^2)-a,(1/((x^2)-a))},{x,-4,4},PlotRange->{-4,4},PlotStyle->{{Thick, Yellow},{Thick,Orange}},AspectRatio->Automatic],{a,-3,3}]

1)  At what function value do the two graphs meet in exactly one point?  Why is it that they only meet at this one point?

2)  When do the vertical asymptotes begin to appear?  Why is that?

3)  As "a" gets larger, what happens to the graph of the reciprocal function?  Why is that?

Answer Key

Example 1

1)  (Piecewise[{{y = -(x^4)+2(x^3)+(x^2)-2x}, {y = 3(x^4)-6(x^3)-3(x^2)+6x}}])

Prediction : The second graph will be stretched vertically by a factor of 3 and reflected across the x - axis.

Plot[{-(x^4)+2(x^3)+(x^2)-2x,3(x^4)-6(x^3)-3(x^2)+6x},{x,-3,3},PlotStyle->{{Thick,Green},{Thick,Red}},PlotRange->{-4,4}]

Surprises : Students might be surprised that both graphs have 
the same x - intercepts.

1)  (Piecewise[{{y = x-[[x]]}, {y = -2(x-[[x]])}}])

Prediction : The second graph will be stretched vertically by 
a factor of 2 and reflected across the x - axis.

Plot[{x-Floor[x],-2*(x-Floor[x])},{x,-3,3},AspectRatio->Automatic,PlotRange->{-3,3},PlotStyle->{{Thick,Yellow},{Thick,Blue}}]

Surprises : Students might be surprised not only that the two 
graphs share the same x - intercepts, but also that they are nothing more than sets of lines.

Example 2

1)  y = x + 1

Prediction : Since the line y = x + 1 intersects the x - axis once, 
then the reciprocal will have one vertical asymptote - and it will 
occur at x = -1.

Plot[{x+1,(1/(x+1))},{x,-5,3},PlotRange->{-4,4},PlotStyle->{{Blue, Thick},{Green,Thick}}]

2)  y = (x^2)-4

Prediction : The graph is the standard parabola shifted down 4 units.  So, it intersects the x - axis in 2 places, at - 2 and 2.  Therefore, there will be two vertical asymptotes: x = -2 and x = 2.

Plot[{(x^2)-4,(1/((x^2)-4))},{x,-4,4},PlotRange->{-4,4},PlotStyle->{{Thick, Yellow},{Thick,Orange}}]

Example 3

1)  At what function value do the two graphs meet in exactly one point?  Why is it that they only meet at this one point?

At y = 1.  The reciprocal of 1 is one.  But, also, this is the 
vertex of the parabola, and it is a minimum, so all other function values of the parabola are greater than 1.  This means that all other function values of the reciprocal function are less than one.  The minimum of a function is the maximum of its reciprocal.

2)  When do the vertical asymptotes begin to appear?  Why is that?

When the parabola touches the x - axis, thus having a function 
value of 0.  The reciprocal of 0 is undefined, hence yielding a vertical asymptote.

3)  As "a" gets larger, what happens to the graph of the reciprocal function?  Why is that?

As the "a" moves farther from the x - axis, its value increases.  
  And, the bigger a number is, the smaller the value of its reciprocal.  Therefore, as "a" gets larger, the reciprocal values "hug" the x - axis closer, as those values are closer to y = 0.