# Shifting Functions

In this lesson, you will learn how to move a function’s graph horizontally or vertically by making simple changes to the formula defining the function.

## The graph of \$y=f(x)+k\$

The table to the right shows the values of \$f(x)\$ for a certain function \$f\$ and a few values of \$x\$.

What are the values of \$f(x)+2\$ at these values of \$x\$?

\$x\$ \$f(x)\$ \$f(x)+2\$
 Where on the grid do the blue points (coming from the \$f(x)+2\$ column) appear, relative to the corresponding red points (coming from the \$f(x)\$ column)? Are they above, below, to the left, or to the right?

Click to see the graphs of \$y_1=f(x)\$ and \$y_2=f(x)+2\$.

 Are the shapes of the red and the blue graphs the same or different?
 Is the graph of \$f(x)+2\$ above, below, to the left, or to the right of the graph of \$f(x)\$?

The equation \$y=f(x)+k\$ is now graphed in green, with a slider for \$k\$.

 As \$k\$ increases, does the green graph move up, down, to the left, or to the right?

We’ll now look at shifting some functions whose formulas we know.

Let \$g(x)=x^2\$. The equation \$y_1=g(x)\$ is graphed on the grid to the left, along with its shifted version \$y=g(x)+k\$.

 Set \$k\$ to 3. Notice that the blue graph is now above the red graph. How many units above the red graph is it?
 What is the equation for \$y\$ in terms of \$x\$ when \$k=3\$? (Use the ‘^’ key to write powers. That is, write \$x^2\$ as “x^2”.)

If one graph is \$d\$ units below another graph, we say that it’s \$-d\$ units “above” the other graph.

 Set \$k\$ to \$-2\$ to move the blue graph. How many units above the red graph is it now?
 What is the equation for \$y\$ in terms of \$x\$ when \$k=-2\$?

In general:

The graph of \$y=f(x)+k\$ has the same shape as the graph of \$y_1=f(x)\$, but shifted up by \$k\$ units. (If \$k\$ is negative, this means it’s shifted down by \$|k|\$ units.)

Now let \$e(x)=x^2-2\$. The equations \$y_1=e(x)\$ and \$y=e(x)+k\$ are graphed on the grid to the left, with a slider for \$k\$.

The graph which has the same shape as the graph of \$y_1=e(x)\$, but is shifted up by 3 units, has the equation \$y=x^2-2+3\$, or \$y=x^2+1\$. You can see this on the grid by sliding \$k\$ to 3.

 What is an equation for the graph which has the same shape as the graph of \$y_1=e(x)\$, but is shifted up by 5 units?
 What is an equation for the graph which has the same shape as the graph of \$y_1=e(x)\$, but is shifted up by \$-3\$ units?

## The graph of \$y=f(x-h)\$

The left-hand table below shows you the values of \$f(x)\$ for a certain function \$\cl"red"f\$, at a few values of \$x\$. To find the value of \$f(x-5)\$ when \$x=1\$, we can first notice that \$1-5=-4\$, and then find the value of \$f(-4)\$ by looking at the \$-4\$ row in the left-hand table. Since \$f(-4)=1\$, \$f(x-5)=1\$ when \$x=1\$.

By using the left-hand table in this way, find the value of \$f(x-5)\$ at each value of \$x\$ in the right-hand table below.

\$x\$ \$f(x)\$
\$x\$ \$x-5\$ \$f(x-5)\$
 Where do the blue points given by \$f(x-5)\$ appear on the grid to the left, compared to the red points given by \$f\$? Are the blue points above, below, to the left, or to the right of the red points?

Click to see the graphs of \$y_1=f(x)\$ and \$y_2=f(x-5)\$.

 Does the blue graph of \$y_2=f(x-5)\$ have the same shape as the red graph of \$y_1=f(x)\$, or a different shape?
 How does the placement of the graph of \$y_2=f(x-5)\$ compare to the placement of the graph of \$y_1=f(x)\$? Is the blue graph above, below, to the left, or to the right of the red graph?

The equation \$y = f(x-h)\$ is now graphed in green, with a slider for \$h\$.

 As \$h\$ changes, does the shape of the graph change?
 As \$h\$ increases, does the green graph move up, down, to the left, or to the right?

We’ll now look again at \$g(x)=x^2\$. The equation \$y_1=g(x)\$ is graphed on the grid to the left, along with its shifted version \$y=g(x-h)\$.

 Set \$h\$ to 4. Notice that the blue graph is to the right of the red graph. How many units to the right of the red graph is it?
 What is the equation for \$y\$ in terms of \$x\$ when \$h=4\$?

Just as a graph that is \$d\$ units below another graph is said to be \$-d\$ units “above” the other graph, a graph that is \$d\$ units to the left of another graph is said to be \$-d\$ units “to the right” of the other graph.

 Set \$h\$ to \$-3\$ to move the blue graph. How many units to the right of the red graph is it?
 What is the equation for \$y\$ in terms of \$x\$ when \$h=-3\$?

In general:

The graph of \$y=f(x-h)\$ has the same shape as the graph of \$y_1=f(x)\$, but shifted right by \$h\$ units. (If \$h\$ is negative, this means it’s shifted left by \$|h|\$ units.)

Now let \$e(x)=(x+1)^2\$. The equations \$y_1=e(x)\$ and \$y=e(x-h)\$ are graphed on the grid to the left, with a slider for \$h\$.

The graph which has the same shape as the graph of \$y_1=e(x)\$, but is shifted right by 3 units, has the equation \$y=(x+1-3)^2\$, or \$y=(x-2)^2\$. You can see this by sliding \$h\$ to 3.

 What is an equation for the graph which has the same shape as the graph of \$y_1=e(x)\$, but is shifted right by 2 units?
 What is an equation for the graph which has the same shape as the graph of \$y_1=e(x)\$, but is shifted right by \$-3\$ units?
 What is an equation for the graph which has the same shape as the graph of \$y_1=e(x)\$, but is shifted right by 3 units and up by \$-4\$ units? (Remember that the graph of \$y=f(x)+k\$ is shifted up by \$k\$ units from the graph of \$y=f(x)\$.)

## Periodic Functions

A phenomenon that always repeats after a certain period of time is called “periodic.” For example, the phases of the moon repeat after roughly 29.5 days.

If \$f\$ is a function and you can find some number \$h\$ (other than \$0\$) so that \$f(x-h)=f(x)\$ for every \$x\$, then \$f\$ is called a periodic function. We’ll now see this means that the graph of \$f\$ repeats whenever \$x\$ is changed by \$h\$.

A new function \$\cl"red"f\$ is now graphed on the grid to the left, along with the graph of \$\cl"blue"{y=f(x-h)}\$.

Slide \$h\$ to \$-4\$, and notice that the graphs of \$y_1=f(x)\$ and \$y=f(x-h)\$ then line up perfectly. This means that \$f(x+4)=f(x)\$ for every \$x\$.

 Using the slider, find three other values of \$h\$ where the graphs of \$y_1=f(x)\$ and \$y=f(x-h)\$ line up perfectly.
 Is \$f\$ a periodic function?

If \$f\$ is periodic, the smallest possible positive \$h\$ where \$f(x-h)=f(x)\$ for every \$x\$ is called the period of \$f\$.

 What is the period of the function \$f\$?
 Suppose \$x\$ represents an amount of time passing in hours, and \$\cl"red"{f(x)}\$ is a measurement taken at time \$x\$. After what period of time does \$\cl"red"{f(x)}\$ first start to repeat itself?