Horizontal Translation of a Function with Examples

The horizontal translation is one of the function transformations that allow us to modify the graph of the original function. When we have a function f(x), we can translate the function horizontally with the transformation f(x+a), where a is a value that can be positive or negative.

Here, we will learn everything related to the horizontal translation of a function. We will look at some examples to illustrate the concepts.

ALGEBRA
Graph of straight line with horizontal transformation

Relevant for

Learning about the horizontal translation of functions.

See transformations

ALGEBRA
Graph of straight line with horizontal transformation

Relevant for

Learning about the horizontal translation of functions.

See transformations

Determining the horizontal translation of a function

The horizontal translation in a function is a transformation that produces a shift to the left or to the right of the original function. That is, the translation occurs parallel to the x-axis.

We can understand the horizontal translation of a function by taking the function $latex f(x)=2x-1$ as an example. When we graph this function, we get the following line:

Graph of function 2x minus 1

Now, we are going to apply the transformations (i) $latex f(x+2)$ and (ii) $latex f(x-2)$. Therefore, using the original function $latex f(x)=2x-1$ and simplifying the transformations, we have:

(i) $latex f(x+2)=2(x+2)-1~$ and (ii) $latex f(x-2)=2(x-2)-1$

(i) $latex f(x+2)=2x+3~$ and (ii) $latex f(x-2)=2x-5$

We can then graph functions (i) and (ii) using the same coordinate plane as the original function to compare their graphs. Therefore, we have:

Graph of straight line with horizontal transformation

In case (i), the transformation $latex f(x+2)$ produced a translation of 2 units to the left. That is, -2 units parallel to the x-axis.

In case (ii), the transformation $latex f(x-2)$ produced a translation of 2 units to the right. That is, 2 units parallel to the x axis.

In short, we have:

  • The transformation $latex f(x+a)$ results in a shift in the original graph of f of $latex a$ units to the left.
  • The transformation $latex f(x-a)$ results in a shift in the original graph of f of $latex a$ units to the right.


Examples of horizontal translation in functions

The following examples are solved using everything you’ve learned about the horizontal translation of functions. Try to solve the examples yourself before looking at the solution.

EXAMPLE 1

Sketch the graph of $latex f(x)=x^2-1$. Then, find the equation of the transformation $latex g(x)=f(x+2)$ and graph it.

Starting with the graph of $latex f(x)$, we have:

Graph of quadratic function 2

Now, we can find the equation of the function $latex g(x)$ by applying the transformation on the original function and simplifying:

$latex g(x)=f(x+2)$

$latex =(x+2)^2-1$

$latex =x^2+4x+4-1$

$latex =x^2+4x+3$

We can graph the function $latex g(x)$ by considering that the graph of g can be obtained by translating the graph of f by 2 units to the left, that is, -2 units on the x-axis.

Graph of quadratic function with horizontal transformation

.

EXAMPLE 2

Graph the cosine function in its base form. Then graph two cosine functions that are shifted 1 unit and 2 units to the right from the base shape.

The base cosine function, $latex f(x)=cos(x)$, has a value of 1 when x equals 0. Also, it passes through the point (π/2, 0) and has a period of π.

To apply a horizontal translation of 1 unit and 2 units to the right, we have to apply the transformations $latex g(x)=f(x-1)$ and $latex h(x)=f(x-2)$ respectively.

When we graph the three functions, we have:

graph of cosine with different phase

EXAMPLE 3

Obtain the graph of $latex g(x)=|x-2|$.

In this example, we have the absolute value function. In its base form, $latex f(x)=|x|$, the graph of the absolute value function is:

graph of absolute value 1

Therefore, the graph of $latex g(x)=|x-2|$ can be obtained by shifting the graph of the absolute value function 2 units to the right when compared to the base form:

graph of absolute value with horizontal displacement

.

EXAMPLE 4

What transformation do we need to apply to shift the function $latex f(x)=\tan(5x-2)$, -4 units parallel to the x-axis?

A shift of -4 units parallel to the x-axis is equivalent to applying a horizontal translation of 4 units to the left.

We can accomplish this translation by applying the $latex f(x-4)$ transformation. In this case, we have the function $latex f(x)=\tan(5x-2)$. Therefore, we have:

$latex f(x-4)=\tan(5(x-4)-2)$

$latex f(x-4)=\tan(5x-20-2)$

$latex f(x-4)=\tan(5x-22)$


Horizontal translation of functions – Practice problems

Solve the following practice problems by applying everything you learned about the horizontal translation of a function.

We have the function $latex f(x)=2\tan(x)$, what is the horizontal translation of function $latex g(x)=2\tan(x-4)$ with respect to f?

Choose an answer






We have the function $latex f(x)=x+2$. Which of the following functions has a translation of -3 units parallel to x with respect to the function f?

Choose an answer






Which of the following functions is shifted 2 units to the right relative to the function $latex f(x)=x^2-x-2$?

Choose an answer







See also

Interested in learning more about function transformations? Take a look at these pages:

Learn mathematics with our additional resources in different topics

LEARN MORE