# 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-modeling/absolute-value-function
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/material/lesson/mathematics/function-modeling/absolute-value-function/en.mdx

Learn absolute value functions with interactive graphs, transformations, and worked solutions. Learn properties, equations, and real applications.

---

## Understanding Absolute Value Functions

An absolute value function is a function that produces positive or zero values from any input, regardless of the original sign of the input. Geometrically, absolute value can be understood as the distance of a number from the zero point on the number line.

### Mathematical Definition

For any real number $$x$$, the absolute value function is defined as:

Visible text: For any real number , the absolute value function is defined as:

```math
f(x) = |x| = \begin{cases} x, & \text{if } x \geq 0 \\ -x, & \text{if } x < 0 \end{cases}
```

**Components of absolute value functions:**

- The symbol $$|x|$$ is read as absolute value of $$x$$.
- The function result is always non-negative ($$|x| \geq 0$$)
- This function is even: $$|-x| = |x|$$

Visible text: - The symbol is read as absolute value of .
- The function result is always non-negative ()
- This function is even:

## Properties of Absolute Value Functions

Absolute value functions have several important properties that need to be understood:

**Basic properties:**

Component: MathContainer
Children:

```math
|x| \geq 0 \text{ for all} x \in \mathbb{R}
```

```math
|-x| = |x|
```

```math
|x|^2 = x^2
```

```math
|xy| = |x| \cdot |y|
```

```math
\left|\frac{x}{y}\right| = \frac{|x|}{|y|}, \text{ with} y \neq 0
```

**Triangle inequality properties:**

Component: MathContainer
Children:

```math
|x + y| \leq |x| + |y|
```

```math
||x| - |y|| \leq |x - y|
```

## Graphs of Absolute Value Functions

The following is a visualization of the basic absolute value function:

Component: LineEquation
Props:
- title: Graph of Function $$f(x) = |x|$$
  Visible text: Graph of Function
- description: The graph shows the characteristic shape of an absolute value function
that forms the letter V.
- data: [
{
points: Array.from({ length: 21 }, (_, i) => {
const x = i - 10;
return { x, y: Math.abs(x), z: 0 };
}),
color: getColor("PURPLE"),
showPoints: false,
smooth: false,
labels: [{ text: "f(x) = |x|", at: 15, offset: [1, -1, 0] }],
},
]
- cameraPosition: [0, 0, 15]
- showZAxis: false

**Value table for function $$f(x) = |x|$$:**

Visible text: **Value table for function :**

| $$x$$ | $$-4$$ | $$-3$$ | $$-2$$ | $$-1$$ | $$0$$ | $$1$$ | $$2$$ | $$3$$ | $$4$$ |
| ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
| $$f(x) = x$$ | $$x$$ | $$x$$ | $$x$$ | $$x$$ | $$x$$ | $$x$$ | $$x$$ | $$x$$ | $$x$$ |

Visible text: | | | | | | | | | | |
| ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- |
| | | | | | | | | | |

## Transformations of Absolute Value Functions

Absolute value functions can be transformed in various ways:

### Vertical Translation

The function $$f(x) = |x| + k$$ shifts the graph upward (if $$k > 0$$) or downward (if $$k < 0$$).

Visible text: The function shifts the graph upward (if ) or downward (if ).

Component: LineEquation
Props:
- title: Vertical Translation
- description: Comparison of $$f(x) = |x|$$ with{" "}
$$g(x) = |x| + 2$$ and{" "}
$$h(x) = |x| - 2$$.
  Visible text: Comparison of with{" "}
 and{" "}
.
- data: [
{
points: Array.from({ length: 21 }, (_, i) => {
const x = i - 10;
return { x, y: Math.abs(x), z: 0 };
}),
color: getColor("PURPLE"),
showPoints: false,
smooth: false,
labels: [{ text: "f(x) = |x|", at: 12, offset: [1, 0.5, 0] }],
},
{
points: Array.from({ length: 21 }, (_, i) => {
const x = i - 10;
return { x, y: Math.abs(x) + 2, z: 0 };
}),
color: getColor("ORANGE"),
showPoints: false,
smooth: false,
labels: [{ text: "g(x) = |x| + 2", at: 12, offset: [1, 0.5, 0] }],
},
{
points: Array.from({ length: 21 }, (_, i) => {
const x = i - 10;
return { x, y: Math.abs(x) - 2, z: 0 };
}),
color: getColor("CYAN"),
showPoints: false,
smooth: false,
labels: [{ text: "h(x) = |x| - 2", at: 12, offset: [1, 0.5, 0] }],
},
]
- cameraPosition: [0, 0, 15]
- showZAxis: false

### Horizontal Translation

The function $$f(x) = |x - h|$$ shifts the graph to the right (if $$h > 0$$) or to the left (if $$h < 0$$).

Visible text: The function shifts the graph to the right (if ) or to the left (if ).

Component: LineEquation
Props:
- title: Horizontal Translation
- description: Comparison of $$f(x) = |x|$$ with{" "}
$$g(x) = |x - 3|$$ and{" "}
$$h(x) = |x + 3|$$.
  Visible text: Comparison of with{" "}
 and{" "}
.
- data: [
{
points: Array.from({ length: 21 }, (_, i) => {
const x = i - 10;
return { x, y: Math.abs(x), z: 0 };
}),
color: getColor("PURPLE"),
showPoints: false,
smooth: false,
labels: [{ text: "f(x) = |x|", at: 12, offset: [1, 0.5, 0] }],
},
{
points: Array.from({ length: 21 }, (_, i) => {
const x = i - 10;
return { x, y: Math.abs(x - 3), z: 0 };
}),
color: getColor("PINK"),
showPoints: false,
smooth: false,
labels: [{ text: "g(x) = |x - 3|", at: 12, offset: [3, 0.5, 0] }],
},
{
points: Array.from({ length: 21 }, (_, i) => {
const x = i - 10;
return { x, y: Math.abs(x + 3), z: 0 };
}),
color: getColor("AMBER"),
showPoints: false,
smooth: false,
labels: [{ text: "h(x) = |x + 3|", at: 12, offset: [1, 0.5, 0] }],
},
]
- cameraPosition: [0, 0, 15]
- showZAxis: false

### Stretching and Compression

The function $$f(x) = a|x|$$ changes the slope of the graph:

Visible text: The function changes the slope of the graph:

- If $$a > 1$$: the graph becomes steeper
- If $$0 < a < 1$$: the graph becomes gentler
- If $$a < 0$$: the graph is inverted (reflection across the $$x$$-axis)

Visible text: - If : the graph becomes steeper
- If : the graph becomes gentler
- If : the graph is inverted (reflection across the -axis)

To make it easier to understand, let's look at the following example:

Component: LineEquation
Props:
- title: Stretching and Compression
- description: Comparison of $$f(x) = |x|$$ with{" "}
$$g(x) = 2|x|$$ and $$h(x) = 0.5|x|$$.
  Visible text: Comparison of with{" "}
 and .
- data: [
{
points: Array.from({ length: 21 }, (_, i) => {
const x = i - 10;
return { x, y: Math.abs(x), z: 0 };
}),
color: getColor("PURPLE"),
showPoints: false,
smooth: false,
labels: [{ text: "f(x) = |x|", at: 12, offset: [1, 0.5, 0] }],
},
{
points: Array.from({ length: 21 }, (_, i) => {
const x = i - 10;
return { x, y: 2 * Math.abs(x), z: 0 };
}),
color: getColor("TEAL"),
showPoints: false,
smooth: false,
labels: [{ text: "g(x) = 2|x|", at: 12, offset: [1, 1, 0] }],
},
{
points: Array.from({ length: 21 }, (_, i) => {
const x = i - 10;
return { x, y: 0.5 * Math.abs(x), z: 0 };
}),
color: getColor("ROSE"),
showPoints: false,
smooth: false,
labels: [{ text: "h(x) = 0.5|x|", at: 12, offset: [3, 0.2, 0] }],
},
]
- cameraPosition: [0, 0, 15]
- showZAxis: false

## General Form of Absolute Value Functions

The general form of an absolute value function is:

```math
f(x) = a|x - h| + k
```

where:

- $$a$$: stretching/compression factor and reflection
- $$h$$: horizontal translation
- $$k$$: vertical translation
- The vertex is located at $$(h, k)$$

Visible text: - : stretching/compression factor and reflection
- : horizontal translation
- : vertical translation
- The vertex is located at

**Transformation table:**

| Parameter                       | Value        | Effect on Graph       |
| ------------------------------- | ------------ | --------------------- |
| $$a > 1$$     | Positive, $$> 1$$ | Graph becomes steeper |
| $$0 < a < 1$$ | Positive, $$< 1$$ | Graph becomes gentler |
| $$a < 0$$     | Negative     | Graph is inverted     |
| $$h > 0$$     | Positive     | Shift to the right    |
| $$h < 0$$     | Negative     | Shift to the left     |
| $$k > 0$$     | Positive     | Shift upward          |
| $$k < 0$$     | Negative     | Shift downward        |

Visible text: | Parameter | Value | Effect on Graph |
| ------------------------------- | ------------ | --------------------- |
| | Positive, | Graph becomes steeper |
| | Positive, | Graph becomes gentler |
| | Negative | Graph is inverted |
| | Positive | Shift to the right |
| | Negative | Shift to the left |
| | Positive | Shift upward |
| | Negative | Shift downward |

## Absolute Value Equations and Inequalities

**Solving absolute value equations:**

To solve $$|x| = a$$ with $$a \geq 0$$:

Visible text: To solve with :

Component: MathContainer
Children:

```math
|x| = a \Rightarrow x = a \text{ or} x = -a
```

**Example:** Solve $$|x - 3| = 5$$

Visible text: **Example:** Solve

Component: MathContainer
Children:

```math
|x - 3| = 5
```

```math
x - 3 = 5 \text{ or} x - 3 = -5
```

```math
x = 8 \text{ or} x = -2
```

**Solving absolute value inequalities:**

For $$|x| < a$$ with $$a > 0$$:

Visible text: For with :

```math
|x| < a \Rightarrow -a < x < a
```

For $$|x| > a$$ with $$a > 0$$:

Visible text: For with :

```math
|x| > a \Rightarrow x < -a \text{ or} x > a
```

## Exercises

1. Determine the value of $$f(x) = |2x - 6|$$ for $$x = -1, 0, 3, 5$$

2. Solve the equation $$|3x + 1| = 7$$

3. Solve the inequality $$|x - 2| < 4$$

4. Determine the vertex of the function $$f(x) = 2|x - 3| + 1$$

5. The distance between two cities is $$150 \text{ km}$$. If city $$A$$ is located at coordinate $$-50 \text{ km}$$, where is city $$B$$ located?

Visible text: 1. Determine the value of for 

2. Solve the equation 

3. Solve the inequality 

4. Determine the vertex of the function 

5. The distance between two cities is . If city is located at coordinate , where is city located?

### Answer Key

1. **Calculating function values for various inputs:**

   Substitute each value of $$x$$ into the function $$f(x) = |2x - 6|$$:

   <MathContainer>
     
   
   ```math
   f(-1) = |2(-1) - 6| = |-2 - 6| = |-8| = 8
   ```

     
   
   ```math
   f(0) = |2(0) - 6| = |0 - 6| = |-6| = 6
   ```

     
   
   ```math
   f(3) = |2(3) - 6| = |6 - 6| = |0| = 0
   ```

     
   
   ```math
   f(5) = |2(5) - 6| = |10 - 6| = |4| = 4
   ```

   </MathContainer>

2. **Solving absolute value equations:**

   For the equation $$|3x + 1| = 7$$, we use the definition of absolute value which produces two possibilities:

   <MathContainer>
     
   
   ```math
   3x + 1 = 7 \quad \text{or} \quad 3x + 1 = -7
   ```

     
   
   ```math
   3x = 6 \quad \text{or} \quad 3x = -8
   ```

     
   
   ```math
   x = 2 \quad \text{or} \quad x = -\frac{8}{3}
   ```

   </MathContainer>

3. **Solving absolute value inequalities:**

   For $$|x - 2| < 4$$, we use the property that $$|a| < b$$ is equivalent to $$-b < a < b$$:

   <MathContainer>
     
   
   ```math
   -4 < x - 2 < 4
   ```

     
   
   ```math
   -4 + 2 < x < 4 + 2
   ```

     
   
   ```math
   -2 < x < 6
   ```

   </MathContainer>

   So the solution set is $$x \in (-2, 6)$$.

4. **Determining the vertex:**

   From the function $$f(x) = 2|x - 3| + 1$$, we can identify the parameters:

   - $$a = 2$$ (stretching factor)
   - $$h = 3$$ (horizontal translation)
   - $$k = 1$$ (vertical translation)

   The vertex is located at $$(h, k) = (3, 1)$$.

5. **Calculating position based on distance:**

   Given that the distance between cities $$A$$ and $$B$$ is $$150 \text{ km}$$, with city $$A$$ at coordinate $$-50 \text{ km}$$. Let city $$B$$ be at coordinate $$x_B$$:

   <MathContainer>
     
   
   ```math
   |-50 - x_B| = 150
   ```

     
   
   ```math
   -50 - x_B = 150 \quad \text{or} \quad -50 - x_B = -150
   ```

     
   
   ```math
   x_B = -50 - 150 = -200 \quad \text{or} \quad x_B = -50 + 150 = 100
   ```

   </MathContainer>

   So city $$B$$ can be located at coordinate $$100 \text{ km}$$ or $$-200 \text{ km}$$.

Visible text: 1. **Calculating function values for various inputs:**

 Substitute each value of into the function :

 <MathContainer>
 
 

 
 

 
 

 
 

 </MathContainer>

2. **Solving absolute value equations:**

 For the equation , we use the definition of absolute value which produces two possibilities:

 <MathContainer>
 
 

 
 

 
 

 </MathContainer>

3. **Solving absolute value inequalities:**

 For , we use the property that is equivalent to :

 <MathContainer>
 
 

 
 

 
 

 </MathContainer>

 So the solution set is .

4. **Determining the vertex:**

 From the function , we can identify the parameters:

 - (stretching factor)
 - (horizontal translation)
 - (vertical translation)

 The vertex is located at .

5. **Calculating position based on distance:**

 Given that the distance between cities and is , with city at coordinate . Let city be at coordinate :

 <MathContainer>
 
 

 
 

 
 

 </MathContainer>

 So city can be located at coordinate or .