# Nakafa Learning Content

> For AI agents: use [llms.txt](https://nakafa.com/llms.txt) for the site index. Markdown versions are available by appending `.md` to content URLs or sending `Accept: text/markdown`.

URL: https://nakafa.com/en/subjects/mathematics/function-transformation/horizontal-translation
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/material/lesson/mathematics/function-transformation/horizontal-translation/en.mdx

Learn how horizontal translation shifts a function's graph left or right without altering its shape, enhancing your understanding of function transformations.

---

## Basic Concepts of Horizontal Translation

Horizontal translation is a geometric transformation that shifts the graph of a function left or right along the $$x$$-axis without changing the shape of the graph. Imagine sliding an object horizontally on a table, its shape remains the same, only its position changes.

Visible text: Horizontal translation is a geometric transformation that shifts the graph of a function left or right along the -axis without changing the shape of the graph. Imagine sliding an object horizontally on a table, its shape remains the same, only its position changes.

If we have a function $$f(x)$$, then horizontal translation produces a new function $$g(x) = f(x - h)$$ where $$h$$ is the translation constant.

Visible text: If we have a function , then horizontal translation produces a new function where is the translation constant.

### Rules of Horizontal Translation

For any function $$f(x)$$, horizontal translation is defined as:

Visible text: For any function , horizontal translation is defined as:

```math
g(x) = f(x - h)
```

Where:

- If $$h > 0$$, the graph shifts to the **right** by $$h \text{ units}$$
- If $$h < 0$$, the graph shifts to the **left** by $$|h| \text{ units}$$
- If $$h = 0$$, there is no translation (graph remains the same)

Visible text: - If , the graph shifts to the **right** by 
- If , the graph shifts to the **left** by 
- If , there is no translation (graph remains the same)

## Visualization of Horizontal Translation

Let's see how horizontal translation works on the quadratic function $$f(x) = x^2$$.

Visible text: Let's see how horizontal translation works on the quadratic function .

Component: LineEquation
Props:
- title: Horizontal Translation of Quadratic Function $$f(x) = x^2$$
  Visible text: Horizontal Translation of Quadratic Function
- description: Notice how the graph shifts horizontally without changing the parabola shape.
- showZAxis: false
- cameraPosition: [12, 8, 12]
- data: [
{
points: Array.from({ length: 41 }, (_, i) => {
const x = (i - 20) * 0.25;
return { x, y: x * x, z: 0 };
}),
color: getColor("PURPLE"),
labels: [{ text: "f(x) = x²", offset: [0.5, 1, 0] }],
showPoints: false,
},
{
points: Array.from({ length: 41 }, (_, i) => {
const x = (i - 20) * 0.25;
return { x, y: (x - 3) * (x - 3), z: 0 };
}),
color: getColor("ORANGE"),
labels: [{ text: "g(x) = (x - 3)²", offset: [0.5, 1, 0] }],
showPoints: false,
},
{
points: Array.from({ length: 41 }, (_, i) => {
const x = (i - 20) * 0.25;
return { x, y: (x + 2) * (x + 2), z: 0 };
}),
color: getColor("TEAL"),
labels: [{ text: "h(x) = (x + 2)²", offset: [0.5, 1, 0] }],
showPoints: false,
},
]

From the visualization above, we can observe:

- The original function $$f(x) = x^2$$ has its vertex at $$(0, 0)$$
- Function $$g(x) = (x - 3)^2$$ shifts right by $$3 \text{ units}$$ with vertex at $$(3, 0)$$
- Function $$h(x) = (x + 2)^2$$ shifts left by $$2 \text{ units}$$ with vertex at $$(-2, 0)$$

Visible text: - The original function has its vertex at 
- Function shifts right by with vertex at 
- Function shifts left by with vertex at

## Horizontal Translation on Linear Functions

Now let's apply the same concept to the linear function $$f(x) = 2x + 1$$.

Visible text: Now let's apply the same concept to the linear function .

Component: LineEquation
Props:
- title: Horizontal Translation of Linear Function $$f(x) = 2x + 1$$
  Visible text: Horizontal Translation of Linear Function
- description: The line maintains the same slope, only its horizontal position changes.
- showZAxis: false
- cameraPosition: [10, 6, 10]
- data: [
{
points: Array.from({ length: 21 }, (_, i) => {
const x = (i - 10) * 0.5;
return { x, y: 2 * x + 1, z: 0 };
}),
color: getColor("VIOLET"),
labels: [{ text: "f(x) = 2x + 1", offset: [1, 0.5, 0] }],
showPoints: false,
},
{
points: Array.from({ length: 21 }, (_, i) => {
const x = (i - 10) * 0.5;
return { x, y: 2 * (x - 4) + 1, z: 0 };
}),
color: getColor("AMBER"),
labels: [{ text: "g(x) = 2(x - 4) + 1", offset: [1, 0.5, 0] }],
showPoints: false,
},
{
points: Array.from({ length: 21 }, (_, i) => {
const x = (i - 10) * 0.5;
return { x, y: 2 * (x + 3) + 1, z: 0 };
}),
color: getColor("CYAN"),
labels: [{ text: "h(x) = 2(x + 3) + 1", offset: [1, 0.5, 0] }],
showPoints: false,
},
]

Notice that:

- All lines have the same slope of $$2$$
- Function $$g(x) = 2(x - 4) + 1$$ shifts right by $$4 \text{ units}$$
- Function $$h(x) = 2(x + 3) + 1$$ shifts left by $$3 \text{ units}$$

Visible text: - All lines have the same slope of 
- Function shifts right by 
- Function shifts left by

## Important Properties of Horizontal Translation

### Graph Shape Remains Unchanged

Horizontal translation preserves the original shape of the graph. The vertical distance between points on the graph remains the same, only the horizontal position changes.

### Effect on Coordinate Points

If point $$(a, b)$$ is on the graph of $$f(x)$$, then after horizontal translation by $$h$$, that point becomes $$(a + h, b)$$ on the graph of $$f(x - h)$$.

Visible text: If point is on the graph of , then after horizontal translation by , that point becomes on the graph of .

### Domain and Range

- **Domain**: Shifts by $$h \text{ units}$$
- **Range**: Does not change after horizontal translation

Visible text: - **Domain**: Shifts by 
- **Range**: Does not change after horizontal translation

If the domain of the original function is $$[c, d]$$, then the domain after horizontal translation $$h$$ becomes $$[c + h, d + h]$$.

Visible text: If the domain of the original function is , then the domain after horizontal translation becomes .

## Application Examples

### Exponential Function Example

Let's look at horizontal translation on the exponential function $$f(x) = 2^x$$.

Visible text: Let's look at horizontal translation on the exponential function .

Component: LineEquation
Props:
- title: Horizontal Translation of Exponential Function $$f(x) = 2^x$$
  Visible text: Horizontal Translation of Exponential Function
- description: The exponential curve maintains its characteristics after horizontal translation.
- showZAxis: false
- cameraPosition: [8, 5, 8]
- data: [
{
points: Array.from({ length: 31 }, (_, i) => {
const x = (i - 15) * 0.3;
return { x, y: Math.pow(2, x), z: 0 };
}),
color: getColor("INDIGO"),
labels: [{ text: "f(x) = 2^x", offset: [0.5, 1, 0] }],
showPoints: false,
},
{
points: Array.from({ length: 31 }, (_, i) => {
const x = (i - 15) * 0.3;
return { x, y: Math.pow(2, x - 2), z: 0 };
}),
color: getColor("EMERALD"),
labels: [{ text: "g(x) = 2^(x-2)", offset: [0.5, 1, 0] }],
showPoints: false,
},
{
points: Array.from({ length: 31 }, (_, i) => {
const x = (i - 15) * 0.3;
return { x, y: Math.pow(2, x + 1), z: 0 };
}),
color: getColor("ROSE"),
labels: [{ text: "h(x) = 2^(x+1)", offset: [0.5, 1, 0] }],
showPoints: false,
},
]

For exponential functions:

- The horizontal asymptote remains at $$y = 0$$ for all functions
- The $$y$$-intercept changes due to horizontal shift
- Function $$g(x) = 2^{x-2}$$ shifts right by $$2 \text{ units}$$
- Function $$h(x) = 2^{x+1}$$ shifts left by $$1 \text{ unit}$$

Visible text: - The horizontal asymptote remains at for all functions
- The -intercept changes due to horizontal shift
- Function shifts right by 
- Function shifts left by

## Difference from Vertical Translation

It's important to understand the difference between horizontal and vertical translation:

### Horizontal Translation

- Changes the function input: $$f(x - h)$$
- Affects the x position of each point
- Domain changes, range remains

Visible text: - Changes the function input: 
- Affects the x position of each point
- Domain changes, range remains

### Vertical Translation

- Changes the function output: $$f(x) + k$$
- Affects the y position of each point
- Domain remains, range changes

Visible text: - Changes the function output: 
- Affects the y position of each point
- Domain remains, range changes

## Exercises

1. Given the function $$f(x) = x^2 + 2x + 1$$. Determine the equation of the function resulting from horizontal translation to the right by $$3 \text{ units}$$.

2. If the graph of function $$g(x) = \sqrt{x}$$ is translated horizontally to the left by $$4 \text{ units}$$, determine:
   - The equation of the resulting translated function
   - The domain of the function after translation

3. Function $$h(x) = 3^x$$ undergoes horizontal translation such that point $$(0, 1)$$ becomes $$(2, 1)$$. Determine the translation constant value and the equation of the resulting translated function.

Visible text: 1. Given the function . Determine the equation of the function resulting from horizontal translation to the right by .

2. If the graph of function is translated horizontally to the left by , determine:
 - The equation of the resulting translated function
 - The domain of the function after translation

3. Function undergoes horizontal translation such that point becomes . Determine the translation constant value and the equation of the resulting translated function.

### Answer Key

1. Horizontal translation to the right by $$3 \text{ units}$$: <InlineMath math="f'(x) = f(x - 3) = (x - 3)^2 + 2(x - 3) + 1 = x^2 - 4x + 4" />

   <LineEquation
     title={<>Function $$f(x) = x^2 + 2x + 1$$ and Its Translation Result</>}
     description={
       <>
         Original quadratic function and the result of horizontal translation to
         the right by $$3 \text{ units}$$.
       </>
     }
     showZAxis={false}
     cameraPosition={[12, 8, 12]}
     data={[
       {
         points: Array.from({ length: 41 }, (_, i) => {
           const x = (i - 20) * 0.25;
           return { x, y: x * x + 2 * x + 1, z: 0 };
         }),
         color: getColor("PURPLE"),
         labels: [{ text: "f(x) = x² + 2x + 1", offset: [1, 1, 0] }],
         showPoints: false,
       },
       {
         points: Array.from({ length: 41 }, (_, i) => {
           const x = (i - 20) * 0.25;
           return { x, y: x * x - 4 * x + 4, z: 0 };
         }),
         color: getColor("ORANGE"),
         labels: [{ text: "f'(x) = x² - 4x + 4", offset: [1, 1, 0] }],
         showPoints: false,
       },
     ]}
   />

2. Equation of the resulting translated function:

   - Translation to the left by $$4 \text{ units}$$: <InlineMath math="g'(x) = g(x + 4) = \sqrt{x + 4}" />
   - Domain after translation: $$x + 4 \geq 0$$, so $$x \geq -4$$ or $$[-4, \infty)$$

   Visualization:

   <LineEquation
     title={<>Function $$g(x) = \sqrt{x}$$ and Its Translation Result</>}
     description={
       <>
         Original square root function and the result of horizontal translation
         to the left by $$4 \text{ units}$$.
       </>
     }
     showZAxis={false}
     cameraPosition={[8, 6, 8]}
     data={[
       {
         points: Array.from({ length: 21 }, (_, i) => {
           const x = i * 0.25;
           return { x, y: Math.sqrt(x), z: 0 };
         }),
         color: getColor("VIOLET"),
         labels: [{ text: "g(x) = √x", offset: [1, 0.5, 0] }],
         showPoints: false,
       },
       {
         points: Array.from({ length: 21 }, (_, i) => {
           const x = i * 0.25 - 4;
           if (x + 4 >= 0) {
             return { x, y: Math.sqrt(x + 4), z: 0 };
           }
           return null;
         }).filter(Boolean),
         color: getColor("TEAL"),
         labels: [{ text: "g'(x) = √(x + 4)", offset: [1, 0.5, 0] }],
         showPoints: false,
       },
     ]}
   />

3. Point $$(0, 1)$$ on $$h(x) = 3^x$$ becomes $$(2, 1)$$, meaning horizontal translation by $$h = 2 \text{ units}$$ to the right.
   Equation of the translation result: <InlineMath math="h'(x) = 3^{x-2}" />

   <LineEquation
     title={<>Function $$h(x) = 3^x$$ and Its Translation Result</>}
     description={
       <>
         Original exponential function and the result of horizontal translation
         to the right by $$2 \text{ units}$$.
       </>
     }
     showZAxis={false}
     cameraPosition={[10, 6, 10]}
     data={[
       {
         points: Array.from({ length: 31 }, (_, i) => {
           const x = (i - 15) * 0.2;
           return { x, y: Math.pow(3, x), z: 0 };
         }),
         color: getColor("INDIGO"),
         labels: [{ text: "h(x) = 3^x", offset: [0.5, 1, 0] }],
         showPoints: false,
       },
       {
         points: Array.from({ length: 31 }, (_, i) => {
           const x = (i - 15) * 0.2;
           return { x, y: Math.pow(3, x - 2), z: 0 };
         }),
         color: getColor("EMERALD"),
         labels: [{ text: "h'(x) = 3^(x-2)", offset: [0.5, 1, 0] }],
         showPoints: false,
       },
     ]}
   />

Visible text: 1. Horizontal translation to the right by : <InlineMath math="f'(x) = f(x - 3) = (x - 3)^2 + 2(x - 3) + 1 = x^2 - 4x + 4" />

 <LineEquation
 title={<>Function and Its Translation Result</>}
 description={
 <>
 Original quadratic function and the result of horizontal translation to
 the right by .
 </>
 }
 showZAxis={false}
 cameraPosition={[12, 8, 12]}
 data={[
 {
 points: Array.from({ length: 41 }, (_, i) => {
 const x = (i - 20) * 0.25;
 return { x, y: x * x + 2 * x + 1, z: 0 };
 }),
 color: getColor("PURPLE"),
 labels: [{ text: "f(x) = x² + 2x + 1", offset: [1, 1, 0] }],
 showPoints: false,
 },
 {
 points: Array.from({ length: 41 }, (_, i) => {
 const x = (i - 20) * 0.25;
 return { x, y: x * x - 4 * x + 4, z: 0 };
 }),
 color: getColor("ORANGE"),
 labels: [{ text: "f'(x) = x² - 4x + 4", offset: [1, 1, 0] }],
 showPoints: false,
 },
 ]}
 />

2. Equation of the resulting translated function:

 - Translation to the left by : <InlineMath math="g'(x) = g(x + 4) = \sqrt{x + 4}" />
 - Domain after translation: , so or 

 Visualization:

 <LineEquation
 title={<>Function and Its Translation Result</>}
 description={
 <>
 Original square root function and the result of horizontal translation
 to the left by .
 </>
 }
 showZAxis={false}
 cameraPosition={[8, 6, 8]}
 data={[
 {
 points: Array.from({ length: 21 }, (_, i) => {
 const x = i * 0.25;
 return { x, y: Math.sqrt(x), z: 0 };
 }),
 color: getColor("VIOLET"),
 labels: [{ text: "g(x) = √x", offset: [1, 0.5, 0] }],
 showPoints: false,
 },
 {
 points: Array.from({ length: 21 }, (_, i) => {
 const x = i * 0.25 - 4;
 if (x + 4 >= 0) {
 return { x, y: Math.sqrt(x + 4), z: 0 };
 }
 return null;
 }).filter(Boolean),
 color: getColor("TEAL"),
 labels: [{ text: "g'(x) = √(x + 4)", offset: [1, 0.5, 0] }],
 showPoints: false,
 },
 ]}
 />

3. Point on becomes , meaning horizontal translation by to the right.
 Equation of the translation result: <InlineMath math="h'(x) = 3^{x-2}" />

 <LineEquation
 title={<>Function and Its Translation Result</>}
 description={
 <>
 Original exponential function and the result of horizontal translation
 to the right by .
 </>
 }
 showZAxis={false}
 cameraPosition={[10, 6, 10]}
 data={[
 {
 points: Array.from({ length: 31 }, (_, i) => {
 const x = (i - 15) * 0.2;
 return { x, y: Math.pow(3, x), z: 0 };
 }),
 color: getColor("INDIGO"),
 labels: [{ text: "h(x) = 3^x", offset: [0.5, 1, 0] }],
 showPoints: false,
 },
 {
 points: Array.from({ length: 31 }, (_, i) => {
 const x = (i - 15) * 0.2;
 return { x, y: Math.pow(3, x - 2), z: 0 };
 }),
 color: getColor("EMERALD"),
 labels: [{ text: "h'(x) = 3^(x-2)", offset: [0.5, 1, 0] }],
 showPoints: false,
 },
 ]}
 />