## What is a Horizontal Shift of a Function?

A **horizontal shift **adds or subtracts a constant to or from every x-value, leaving the y-coordinate unchanged. The basic rules for shifting a function along a horizontal (x) are:

## Rules for Horizontal Shift of a Function

Compared to a base graph of f(x),

- y = f(x +
h) shiftshunits to the left,- y = f(x –
h) shiftshunits to the right,Where

h> 0.

Look carefully at what the positive or negative added value *h* is doing: **it’s the opposite of what you might expect**. Positive values of *h* shift in the negative direction along the number line and negative h values shift the positive direction.

## Example of a Horizontal Shift

A horizontal shift of the function f(x) = x^{2} of 2 units (i.e. *h* = 2) results in:

- f(x) = x
^{2}+ 3 (3 units to the left), - f(x) = x
^{2}+ 3 (3 units to the right)

The following graph shows the base function f(x) = x^{2} and the two “new” graphs created when we added 2 or subtracted 2.

## Example Questions

**Example question #1:** How are the graphs of y = √(x) and y = √(x + 1) related?

**Solution**:

Step 1: Compare the *right sides* of both equations and note any differences:

- √(x)
- √(x + 1)

The difference between the equations is a “+ 1”.

Step 2: Choose a rule based on whether Step 1 was positive or negative:

*Step 1* for this example was positive (+ 1), so that’s rule 1:

*y = f(x + h) shifts h units to the left *

Step 3: Place your base function (from the question) into the rule, in place of “x”:

*y = f(√(x) + h) shifts h units to the left *

Step 4: Place “h” — the difference you found in Step 1 — into the rule from Step 3:

*y = f(√(x) + 2) shifts 2 units to the left *

*That’s it!*

**Example question #2: **The following graph shows how the average cost of a new car tire compares from Jacksonville, Florida (red) to Miami, Florida (Blue). Write a formula for the transformation of g (blue graph) to f (red graph).

**Solution**: The graph g shifts 10 units to the right of f, so:

**g(x) = f(x – 20) **.

If you’re not sure about how I arrived at this formula, the following few steps break it down into simple parts:

Step 1: **Decide which direction the graph is traveling ** (left, or right?). The question asks is for a formula for the transformation of g (blue graph) as a transformation of f (red graph). In other words, what direction do we need to travel to turn f into g? A look at the graph shows that moves to the right.

Step 2: **Take your answer from Step 1 and then refer to the rules **to tell you whether it’s a positive or negative shift.

Rule 2 states:

y = f(x – *h*) shifts *h* units to the right.

That means moving to the right must mean we have a “-” shift.

Put this value aside for a moment.

Step 3: **Locate two x-values on the horizontal axis**: one for each graph:

- g (blue graph) = 70
- f (red graph) = 90.

Step 4: **Subtract the lowest number in Step 3 from the highest:**

90 – 70 = 20.

Step 5: Combine your answers from Steps 2 and 4:

– 20.

Step 6: **Place your answer from Step 5 into the rule you chose in Step 2,** replacing the “h” with your value (- 20 in this example):

g(x) = f(x – 20)

Don’t forget to rename the formula with the one given in the question!

## References

Graph created with Desmos.com.

**CITE THIS AS:**

**Stephanie Glen**. "Horizontal Shift of a Function" From

**CalculusHowTo.com**: Calculus for the rest of us! https://www.calculushowto.com/horizontal-shift-of-a-function/

**Need help with a homework or test question?** With Chegg Study, you can get step-by-step solutions to your questions from an expert in the field. Your first 30 minutes with a Chegg tutor is free!