The Joy of Transformations of Functions
~26 minLast year, I was first called upon to teach a section of our college algebra course, MATH 120. It was an interesting experience, to say the least, and it opened my eyes to a few beautiful elements of the subject that I had never noticed before.
My journey with algebra proper started and ended in junior high school. In fact, I believe that the last algebra course I took was when I was in ninth grade. When I went to college, I started out right in calculus and never looked back. So, naturally, I didn't have particularly high expectations for the content. "It's just moving around in equations, and that odd 'completing the square' thing that I haven't done in years, surely," I thought to myself. "Oh, and memorizing a bunch of random forms of specific equations that they'll never use again... that too!"
And so it was with rather low expectations that I opened up an algebra text for the first time in a decade. It was Blitzer's College Algebra Essentials, a book that the lead of the program had selected "because they all suck, and at least this one is cheap." And, to be honest, the book itself lived up to every one of my low expectations.
But once I fought through the colorful pictures of unrelated television personalities and got to the mathematics itself, I discovered something very special.
Over the past few years, I've really started to appreciate my "computer science brain." I don't know where the point of inflection was, but at some point between when I started learning to program and today, my mind has adapted itself to working with rules and abstractions as almost a matter of course. And exposing this new mind of mine to a topic that I had, quite honestly, loathed back in junior high produced unexpected results. I started noticing patterns.
Transformations of Functions: A Summary#
Where everything started to come together for me was when I was reading over Blitzer's section on Transformations of Functions. For those of you who have been out of algebra for as long as I had been, let me summarize these here.
The basic idea is that there are consistent arithmetic adjustments that you can make to functions that will allow you to alter the form of their graph. You can translate functions up and down, stretch them horizontally or vertically, and reflect them across the and -axis. And, most importantly, these rules are extremely consistent. It doesn't matter what the function is--these rules will work on it.
Horizontal Translation#
Given a function , I can translate the function horizontally by using . To give a specific example, consider the function,
I can create a new function, say , that is the same as , except with every point shifted by units to the right along the -axis, by doing the following,
Or, if I prefer, I can shift everything to the left by units instead to create ,
Figure 1, below, shows all three of these graphs.
This rule makes a lot of sense. You can shift the graph horizontally, in other words along the -axis, by adding or subtracting from the values. The only tricky part is that the directions are reversed from what one might expect: you subtract to move right and add to move left. But it does make sense once you tear into the actual numbers. I won't spoil the joy of figuring out why it works, if you don't already know. Take a moment and write out tables of and values for , , and above. If you study these closely, you might be able to determine what is going on!
Vertical Translation#
For the case of vertical translation, I have actually adopted a different approach to teaching it compared to the standard. However, I'll address this later and focus on the traditional approach used in Blitzer, and other algebra texts. We'll discuss "my way" later.
Given a function , I can translate the function vertically by using . To give a specific example, consider the function,
I can create a new function, say , that is the same as , except with every point shifted by units up along the -axis,
I can also shift everything down by units instead to create ,
Figure 2 shows the graphs of these three functions.
This rule also makes sense. It is a bit odd that the sign conventions are reversed compared to horizontal translations, but it does again seem reasonable that we can shift the graph vertically, along the -axis, by adding or subtracting from the function itself. (Remember, we often say that -- is just another name for .)
Horizontal Stretching#
The stretching of the graph of a function is a lot harder to get a handle on. To be honest, it actually isn't something that I require my students to learn outside of just exposure to the idea that it is accomplished by multiplication and division. However, I do want to discuss these here too--because they are useful to the discussion that I ultimately want to get to. So please bear with me as I fumble through attempting to explain these!
In order to really appreciate the difference between a horizontal and a vertical stretch, we need to examine the and -intercepts of the function. So I'm going to transition to a different base function than the bare quadratic I've been using. For our horizontal stretching discussion, let's consider . This function is a tad more complex, but it has -intercepts for us to look at. These are critical for understanding the differences here.
When I "stretch" my function horizontally, I am going to take its -intercepts and increase their magnitude (effectively spreading them apart, in the case of this parabola). I can accomplish this by dividing in my function by a constant. For example, if I wanted to double the magnitude of my -intercepts, I would divide by . So I can create a new function, , using,
If I multiply rather than dividing, then I can shrink the magnitude of (and, by extension, the distance between) my -intercepts. So multiplying by is going to cut the magnitude of the intercepts of my function in half, creating ,
Hopefully, this figure will make these stretching and shrinking shenanigans a bit more clear. Figure 3 shows graphs of , , and .
This figure warrants a bit of discussion. The -intercepts of the "base" function, , are located at and . When I divide by , stretching horizontally as in , the coordinates of these intercepts double and we see intercepts of and instead.
The same goes for the shrink, demonstrated by . Multiplying by has the effect of cutting the intercepts in half. This function has intercepts at and .
Also, notice through all of this that our -intercept has remained unchanged. A horizontal stretch will not change the -intercept.
So, just to summarize: you stretch or shrink the -intercepts (a horizontal stretch or shrink) by multiplying or dividing . To stretch and increase their magnitude, divide , and to shrink and decrease their magnitude, multiply .
Vertical Stretching#
Next, we'll do vertical stretching. This will move around our -intercept, so let's define a new base function, , to use for our example. This will have a non-zero -intercept so we can see what effects our stretching has.
First, we will do a vertical stretch. If we multiply itself by two, this will double the value of the -intercept. Thus, we construct ,
Notice that--just like with the horizontal vs. vertical translations--the rules are strangely reversed for horizontal and vertical stretches. A horizontal stretch requires dividing by the stretch factor, while a vertical one requires multiplying by it. We'll address this later.
Likewise, we can do a vertical shrink by dividing itself by two. This will cut the value of the -intercept in half. Let's call this ,
Graphing all three of these cases will give us Figure 4.
Notice that our base function has a -intercept of . Our stretching of this function by a factor of two properly doubles this intercept, moving it up to , and shrinking by a factor of two cuts it in half, bringing it down to . Note that, just like our horizontal stretch maintained the -intercept, our vertical stretch maintained the -intercepts.
Horizontal and Vertical Reflections#
Finally, we can reflect the graph across the or -axis. This is actually a special case of stretching, and occurs when we use a negative stretch factor. Let's consider a sufficiently complex function to make this interesting,
We can reflect this graph horizontally by stretching it with a horizontal factor of . This will give us ,
And, likewise, we can flip it vertically by stretching it with a vertical factor of . Let's call this one ,
Figure 5 shows the results of these reflections. Let's look at it in detail. Our "base" function, , has an -intercept at just shy of , and a -intercept at . How did our reflections affect these intercepts?
Well, the horizontal reflection, shown by , reveals that the sign of our -intercept flipped, while leaving the -intercept the same. This basically follows the rules that we saw above with our stretches and shrinks. We multiplied the -intercepts by our stretch factor, and left the -intercepts alone.
The same story is reflected (no pun intended) in our vertical reflection in . Both and have the same -intercept, however has a -intercept at . The -intercepts were flipped!
Note that this does lend itself to a somewhat backwards logic. A flipping of the -intercepts is going to result in the graph reflecting across the -axis, and a flipping of the -intercepts will result in the graph reflecting across the -axis. Again, there isn't anything here that shouldn't make sense once it's been thought upon for a while--but it is odd and backwards at first glance.
Transformations of Equations#
Okay--so I have just walked you through an (abbreviated) traditional approach to discussing this topic. I'm not fond of this approach because of the inconsistencies between the horizontal and vertical transformations. Why is it that these rules are reversed for the vertical ones, relative to the horizontal ones? And this approach also ties these transformations directly to functions, when they are far more powerful than that. We can apply these same transformations to many equations that are not functions at all!
So, I find that discussing these in the context of functions specifically is a bit limiting. What I do instead is consider them more generically--as applies to any equation of two variables, which I'll call and in keeping with tradition. This has the double benefit of removing the artificial dependence on functional notation, and also removing the inconsistencies between vertical and horizontal transformations.
Here is what I do. First, I'll recreate my translations, given .
The first step is to abandon the function notation and revert back to using ,
When you do this, something magical happens. Remember how we could shift this graph up by by adding two to the end?
Hey! Look at that. Rather than using this odd backwards convention for vertical shifts, we can subtract from . The same deal applies for the stretch and shrink situation. A vertical stretch was achieved by multiplying our function by ,
We can revert this back to the exact same convention as a horizontal stretch if we look at it in terms of altering the variable, rather than the whole function.
What this gives us, in effect, is a very consistent set of rules:
- For a horizontal translation, add to to move left and subtract from to move right.
- For a vertical translation, add to to move down and subtract from to move up.
- For a horizontal stretch, multiply to decrease the -intercepts and divide to increase them.
- For a vertical stretch, multiply to decrease the -intercepts and divide to increase them.
The same rules now apply, where altering performs horizontal transformations, and altering performs vertical ones. In effect, we've cut the number of rules that need to be memorized in half!
Transformations of a Circle#
This scheme has the added benefit of allowing us to apply these rules easily to equations that are not functions. For example, consider the humble unit circle,
We can apply our translation rules to move this circle around wherever we want! Figure 6 demonstrates this--the rules work for this! And they'll work for other "non-functions" too, such as hyperbolas and square roots.
With circles specifically, something really cool happens when we start applying stretches. If we stretch it horizontally and vertically by the same amounts, then we increase the radius, as you might expect:
What is particularly neat here is that examining this result closely can show why it is that the radius in the standard form of a circle is squared. If we do this in general terms,
Things get even neater when we start to apply asymmetrical stretches. What happens if we stretch horizontally and vertically by different amounts?
If we stretch horizontally by and vertically by , then we end up with the general equation,
which you may recognize as the standard form of an ellipse. And we can derive it by simply starting with the "base" equation for the unit circle, and applying transformations.
Transformations of a Line#
The standard form of most types of equation can be found by applying transformations like this. For example, consider a linear function,
We know that this graph will cross the point . So, we can apply transformations to move this point anywhere we want. If we want to move that point, which normally resides on the origin, to a new location , we can apply our translation rules,
Next, let's do our stretching. We will stretch horizontally by a factor called and vertically by a factor called . This will get us,
where . This equation, derived by applying basic transformations, should be readily recognized by any student of algebra.
Transformations of a Parabola#
Let's do the same thing with a parabola. Our base function is , and so we will start with
Just as with the line, we have a point (the vertex in this case) sitting at , so we can shift that onto any point we want, say , using these transformations,
And we can apply our stretches too. Let's call the horizontal stretch and the vertical stretch ,
where . Again, this equation should look very familiar.
Conclusion#
I could keep going but I suspect that you get the point. When I was in junior high, these transformation rules seemed arbitrary and silly, and--to be honest--I completely forgot them in short order. I had a vague memory of rules like this existing, but until I opened Blitzer up to this section and refreshed my memory, I couldn't have told you what they were.
On my first pass, I was annoyed at the strange reversal of the rules between horizontal and vertical transformations. Why was it that way, and was there some way to avoid it? Simpler rules would be easier, after all, for my students to understand--or at least for them to memorize. And so, after some experimentation, I hit upon the system I described above.
This allows me to not only reduce the set of rules that need to be learned, but also to use those rules to derive many of the equations that would traditionally need to be memorized. Which is a very satisfying result to me. After all, mathematics is not about memorization. It's about applying a small set of rules in creative and interesting ways. And I think that the more opportunities we get to show this approach to math to our students, the better off they will be.