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

Learn to draw logarithmic function graphs one step at a time. Explore transformations, asymptotes, and key characteristics with interactive visualizations.

---

## Understanding Logarithmic Function Graphs

Have you ever noticed how sound decreases in intensity as we move away from its source? Or how the pH of a solution changes? These phenomena can be modeled with logarithmic function graphs. Let's learn the characteristics and how to draw logarithmic function graphs.

## Characteristics of Logarithmic Graphs

Logarithmic function graphs have a distinctive shape different from other functions. Let's look at the basic graph $$y = \log_b x$$ for various base values.

Visible text: Logarithmic function graphs have a distinctive shape different from other functions. Let's look at the basic graph for various base values.

Component: LineEquation
Props:
- title: Comparison of Logarithmic Graphs with Different Bases
- description: Logarithmic function graphs for $$b > 1$$.
  Visible text: Logarithmic function graphs for .
- data: [
{
points: Array.from({ length: 100 }, (_, i) => {
const x = (i / 99) * 10 + 0.1;
return { x, y: Math.log2(x), z: 0 };
}),
color: getColor("SKY"),
labels: [{ text: "y = log₂ x", at: 70, offset: [0.5, -0.4, 0] }],
showPoints: false,
},
{
points: Array.from({ length: 100 }, (_, i) => {
const x = (i / 99) * 10 + 0.1;
return { x, y: Math.log10(x), z: 0 };
}),
color: getColor("ROSE"),
labels: [{ text: "y = log₁₀ x", at: 70, offset: [0.5, -0.5, 0] }],
showPoints: false,
},
{
points: Array.from({ length: 100 }, (_, i) => {
const x = (i / 99) * 10 + 0.1;
return { x, y: Math.log(x), z: 0 };
}),
color: getColor("EMERALD"),
labels: [{ text: "y = ln x", at: 70, offset: [0.5, -0.5, 0] }],
showPoints: false,
},
]
- cameraPosition: [0, 0, 15]
- showZAxis: false

### Important Properties of Logarithmic Graphs

For function $$f(x) = \log_b x$$ with $$b > 1$$:

Visible text: For function with :

1. **Domain**: $$x > 0$$ (positive numbers only)
2. **Range**: All real numbers ($$-\infty < y < \infty$$)
3. **$$x$$-intercept**: $$(1, 0)$$ because $$\log_b 1 = 0$$
4. **Vertical asymptote**: $$y$$-axis ($$x = 0$$)
5. **Function behavior**:
   - Increasing for $$b > 1$$
   - Decreasing for $$0 < b < 1$$

Visible text: 1. **Domain**: (positive numbers only)
2. **Range**: All real numbers ()
3. **-intercept**: because 
4. **Vertical asymptote**: -axis ()
5. **Function behavior**:
 - Increasing for 
 - Decreasing for

## Drawing Logarithmic Function Graphs

Let's learn the steps to draw logarithmic function graphs with concrete examples.

1. **Drawing $$y = \log_2 x$$**

   To draw this graph, we create a table of values by choosing $$x$$ values that are powers of $$2$$:

   | $$x$$            | $$\frac{1}{8}$$ | $$\frac{1}{4}$$ | $$\frac{1}{2}$$ | $$1$$ | $$2$$ | $$4$$ | $$8$$ |
   | ---------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | --- | --- | --- | --- |
   | $$y = \log_2 x$$ | $$-3$$ | $$-2$$ | $$-1$$ | $$0$$ | $$1$$ | $$2$$ | $$3$$ |

   <LineEquation
     title={
       <>
         Graph of $$y = \log_2 x$$
       </>
     }
     description="Notice the important points and the curve shape."
     data={[
       {
         points: Array.from({ length: 100 }, (_, i) => {
           const x = (i / 99) * 10 + 0.01;
           return { x, y: Math.log2(x), z: 0 };
         }),
         color: getColor("SKY"),
         labels: [{ text: "y = log₂ x", at: 50, offset: [0.5, 1, 0] }],
         showPoints: false,
       },
       {
         points: [
           { x: 0.125, y: -3, z: 0 },
           { x: 0.25, y: -2, z: 0 },
           { x: 0.5, y: -1, z: 0 },
           { x: 1, y: 0, z: 0 },
           { x: 2, y: 1, z: 0 },
           { x: 4, y: 2, z: 0 },
           { x: 8, y: 3, z: 0 },
         ],
         color: getColor("ROSE"),
         showPoints: true,
         labels: [{ text: "(1, 0)", at: 3, offset: [0.5, 0.5, 0] }],
       },
     ]}
     cameraPosition={[0, 0, 15]}
     showZAxis={false}
   />

2. **Drawing $$y = \log_{\frac{1}{3}} x$$**

   For base $$0 < b < 1$$, the graph will be decreasing:

   | $$x$$                        | $$\frac{1}{27}$$ | $$\frac{1}{9}$$ | $$\frac{1}{3}$$ | $$1$$ | $$3$$ | $$9$$ | $$27$$ |
   | ---------------------------------------------- | ---------------------------------- | --------------------------------- | --------------------------------- | --- | --- | --- | --- |
   | $$y = \log_{\frac{1}{3}} x$$ | $$3$$ | $$2$$ | $$1$$ | $$0$$ | $$-1$$ | $$-2$$ | $$-3$$ |

   <LineEquation
     title={
       <>
         Graph of $$y = \log_{\frac{1}{3}} x$$
       </>
     }
     description="Graph decreases because the base is less than 1."
     data={[
       {
         points: Array.from({ length: 100 }, (_, i) => {
           const x = (i / 99) * 10 + 0.01;
           return { x, y: Math.log(x) / Math.log(1 / 3), z: 0 };
         }),
         color: getColor("ROSE"),
         labels: [{ text: "y = log₁/₃ x", at: 30, offset: [0.5, -1, 0] }],
         showPoints: false,
       },
       {
         points: [
           { x: 1 / 27, y: 3, z: 0 },
           { x: 1 / 9, y: 2, z: 0 },
           { x: 1 / 3, y: 1, z: 0 },
           { x: 1, y: 0, z: 0 },
           { x: 3, y: -1, z: 0 },
           { x: 9, y: -2, z: 0 },
         ],
         color: getColor("PURPLE"),
         showPoints: true,
         labels: [{ text: "(1, 0)", at: 3, offset: [0.5, 0.5, 0] }],
       },
     ]}
     cameraPosition={[0, 0, 15]}
     showZAxis={false}
   />

Visible text: 1. **Drawing **

 To draw this graph, we create a table of values by choosing values that are powers of :

 | | | | | | | | |
 | ---------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | --- | --- | --- | --- |
 | | | | | | | | |

 <LineEquation
 title={
 <>
 Graph of 
 </>
 }
 description="Notice the important points and the curve shape."
 data={[
 {
 points: Array.from({ length: 100 }, (_, i) => {
 const x = (i / 99) * 10 + 0.01;
 return { x, y: Math.log2(x), z: 0 };
 }),
 color: getColor("SKY"),
 labels: [{ text: "y = log₂ x", at: 50, offset: [0.5, 1, 0] }],
 showPoints: false,
 },
 {
 points: [
 { x: 0.125, y: -3, z: 0 },
 { x: 0.25, y: -2, z: 0 },
 { x: 0.5, y: -1, z: 0 },
 { x: 1, y: 0, z: 0 },
 { x: 2, y: 1, z: 0 },
 { x: 4, y: 2, z: 0 },
 { x: 8, y: 3, z: 0 },
 ],
 color: getColor("ROSE"),
 showPoints: true,
 labels: [{ text: "(1, 0)", at: 3, offset: [0.5, 0.5, 0] }],
 },
 ]}
 cameraPosition={[0, 0, 15]}
 showZAxis={false}
 />

2. **Drawing **

 For base , the graph will be decreasing:

 | | | | | | | | |
 | ---------------------------------------------- | ---------------------------------- | --------------------------------- | --------------------------------- | --- | --- | --- | --- |
 | | | | | | | | |

 <LineEquation
 title={
 <>
 Graph of 
 </>
 }
 description="Graph decreases because the base is less than 1."
 data={[
 {
 points: Array.from({ length: 100 }, (_, i) => {
 const x = (i / 99) * 10 + 0.01;
 return { x, y: Math.log(x) / Math.log(1 / 3), z: 0 };
 }),
 color: getColor("ROSE"),
 labels: [{ text: "y = log₁/₃ x", at: 30, offset: [0.5, -1, 0] }],
 showPoints: false,
 },
 {
 points: [
 { x: 1 / 27, y: 3, z: 0 },
 { x: 1 / 9, y: 2, z: 0 },
 { x: 1 / 3, y: 1, z: 0 },
 { x: 1, y: 0, z: 0 },
 { x: 3, y: -1, z: 0 },
 { x: 9, y: -2, z: 0 },
 ],
 color: getColor("PURPLE"),
 showPoints: true,
 labels: [{ text: "(1, 0)", at: 3, offset: [0.5, 0.5, 0] }],
 },
 ]}
 cameraPosition={[0, 0, 15]}
 showZAxis={false}
 />

## Comparing Logarithmic Graphs

Let's compare logarithmic graphs with different bases on one coordinate system:

Component: LineEquation
Props:
- title: Comparison of Logarithmic Graphs $$b > 1$$ and{" "}
$$0 < b < 1$$.
  Visible text: Comparison of Logarithmic Graphs and{" "}
.
- description: Notice the difference in graph direction.
- data: [
{
points: Array.from({ length: 100 }, (_, i) => {
const x = (i / 99) * 8 + 0.01;
return { x, y: Math.log2(x), z: 0 };
}),
color: getColor("SKY"),
labels: [
{ text: "y = log₂ x (increasing)", at: 40, offset: [0.5, 0.5, 0] },
],
showPoints: false,
},
{
points: Array.from({ length: 100 }, (_, i) => {
const x = (i / 99) * 8 + 0.01;
return { x, y: Math.log(x) / Math.log(0.5), z: 0 };
}),
color: getColor("ROSE"),
labels: [
{ text: "y = log₀.₅ x (decreasing)", at: 40, offset: [0.5, -0.5, 0] },
],
showPoints: false,
},
{
points: [
{ x: 0, y: -4, z: 0 },
{ x: 0, y: 4, z: 0 },
],
color: getColor("PURPLE"),
labels: [{ text: "x = 0 (asymptote)", at: 1, offset: [0.5, 0, 0] }],
showPoints: false,
},
]
- cameraPosition: [0, 0, 12]
- showZAxis: false

| Property           | $$b > 1$$  | $$0 < b < 1$$ |
| ------------------ | ---------------------------- | ------------------------------- |
| Graph direction    | Increasing (monotonic)       | Decreasing (monotonic)          |
| Domain             | $$x > 0$$  | $$x > 0$$     |
| Range              | All real numbers             | All real numbers                |
| $$x$$-intercept        | $$(1, 0)$$ | $$(1, 0)$$    |
| Vertical asymptote | $$x = 0$$  | $$x = 0$$     |

Visible text: | Property | | |
| ------------------ | ---------------------------- | ------------------------------- |
| Graph direction | Increasing (monotonic) | Decreasing (monotonic) |
| Domain | | |
| Range | All real numbers | All real numbers |
| -intercept | | |
| Vertical asymptote | | |

## Transformations of Logarithmic Graphs

Logarithmic graphs can be transformed in various ways:

### Vertical Translation

We can shift the logarithmic function graph by adding or subtracting a constant $$k$$ to the function.

Visible text: We can shift the logarithmic function graph by adding or subtracting a constant to the function.

Component: ContentStack
Children:

```math
y = \log_b x + k
```

Component: LineEquation
Props:
- title: Vertical Translation
- description: Graph shifts up if $$k > 0$$ and down if{" "}
$$k < 0$$.
  Visible text: Graph shifts up if and down if{" "}
.
- data: [
{
points: Array.from({ length: 100 }, (_, i) => {
const x = (i / 99) * 10 + 0.1;
return { x, y: Math.log2(x), z: 0 };
}),
color: getColor("PURPLE"),
labels: [{ text: "y = log₂ x", at: 40, offset: [0.5, -1, 0] }],
showPoints: false,
},
{
points: Array.from({ length: 100 }, (_, i) => {
const x = (i / 99) * 10 + 0.1;
return { x, y: Math.log2(x) + 2, z: 0 };
}),
color: getColor("SKY"),
labels: [{ text: "y = log₂ x + 2", at: 40, offset: [0.5, -1, 0] }],
showPoints: false,
},
{
points: Array.from({ length: 100 }, (_, i) => {
const x = (i / 99) * 10 + 0.1;
return { x, y: Math.log2(x) - 2, z: 0 };
}),
color: getColor("ROSE"),
labels: [{ text: "y = log₂ x - 2", at: 40, offset: [0.5, -1, 0] }],
showPoints: false,
},
]
- cameraPosition: [0, 0, 15]
- showZAxis: false

### Horizontal Translation

We can shift the logarithmic function graph by adding or subtracting a constant $$h$$ to the function.

Visible text: We can shift the logarithmic function graph by adding or subtracting a constant to the function.

Component: ContentStack
Children:

```math
y = \log_b (x - h)
```

Component: LineEquation
Props:
- title: Horizontal Translation
- description: Graph shifts right if $$h > 0$$ and left if{" "}
$$h < 0$$.
  Visible text: Graph shifts right if and left if{" "}
.
- data: [
{
points: Array.from({ length: 100 }, (_, i) => {
const x = (i / 99) * 10 + 0.1;
return { x, y: Math.log2(x), z: 0 };
}),
color: getColor("PURPLE"),
labels: [{ text: "y = log₂ x", at: 40, offset: [0.5, 1, 0] }],
showPoints: false,
},
{
points: Array.from({ length: 100 }, (_, i) => {
const x = (i / 99) * 8 + 2.1;
return { x, y: Math.log2(x - 2), z: 0 };
}),
color: getColor("EMERALD"),
labels: [{ text: "y = log₂(x - 2)", at: 40, offset: [1, -1, 0] }],
showPoints: false,
},
]
- cameraPosition: [0, 0, 15]
- showZAxis: false

## Exercises

1. Create a value table and draw the graphs of:

   - $$y = \log_3 x$$
   - $$y = \log_{\frac{1}{2}} x$$

2. Determine the domain, range, and asymptote of function $$f(x) = \log_5 (x + 3)$$.

3. If $$f(x) = \log_2 x$$ and $$g(x) = \log_2 (x - 4)$$, determine:

   - The shift of graph $$g(x)$$ relative to $$f(x)$$
   - The domain of $$g(x)$$

4. Sketch the graph of $$y = \log_3 x + 2$$ and determine the $$y$$-intercept.

Visible text: 1. Create a value table and draw the graphs of:

 - 
 - 

2. Determine the domain, range, and asymptote of function .

3. If and , determine:

 - The shift of graph relative to 
 - The domain of 

4. Sketch the graph of and determine the -intercept.

### Answer Key

1. Value tables:

   For $$y = \log_3 x$$:
   | $$x$$ | $$\frac{1}{9}$$ | $$\frac{1}{3}$$ | $$1$$ | $$3$$ | $$9$$ |
   |-------------------------|-------------------------------------|------------------------------------|----|----|----|
   | $$y$$ | $$-2$$ | $$-1$$ | $$0$$ | $$1$$ | $$2$$ |

   For $$y = \log_{\frac{1}{2}} x$$:
   | $$x$$ | $$\frac{1}{4}$$ | $$\frac{1}{2}$$ | $$1$$ | $$2$$ | $$4$$ |
   |-------------------------|-------------------------------------|------------------------------------|----|----|----|
   | $$y$$ | $$2$$ | $$1$$ | $$0$$ | $$-1$$ | $$-2$$ |

2. For $$f(x) = \log_5 (x + 3)$$:

   - Domain: $$x + 3 > 0 \Rightarrow x > -3$$
   - Range: All real numbers
   - Vertical asymptote: $$x = -3$$

3. For $$g(x) = \log_2 (x - 4)$$:

   - Shift: $$4 \text{ units}$$ to the right
   - Domain: $$x - 4 > 0 \Rightarrow x > 4$$

4. For $$y = \log_3 x + 2$$:

   - Graph $$y = \log_3 x$$ shifted $$2 \text{ units}$$ up
   - There is no $$y$$-intercept because the domain is $$x > 0$$

   <ContentBlock>
     <LineEquation
       title={
         <>
           Sketch of Graph $$y = \log_3 x + 2$$
         </>
       }
       description={
         <>
           Logarithmic graph base $$3$$ shifted $$2 \text{ units}$$ up.
         </>
       }
       data={[
         {
           points: Array.from({ length: 100 }, (_, i) => {
             const x = (i / 99) * 10 + 0.01;
             return { x, y: Math.log(x) / Math.log(3), z: 0 };
           }),
           color: getColor("PURPLE"),
           labels: [{ text: "y = log₃ x", at: 40, offset: [0.5, -0.5, 0] }],
           showPoints: false,
         },
         {
           points: Array.from({ length: 100 }, (_, i) => {
             const x = (i / 99) * 10 + 0.01;
             return { x, y: Math.log(x) / Math.log(3) + 2, z: 0 };
           }),
           color: getColor("EMERALD"),
           labels: [{ text: "y = log₃ x + 2", at: 50, offset: [0.5, 1, 0] }],
           showPoints: false,
         },
         {
           points: [
             { x: 1 / 9, y: Math.log(1 / 9) / Math.log(3) + 2, z: 0 },
             { x: 1 / 3, y: Math.log(1 / 3) / Math.log(3) + 2, z: 0 },
             { x: 1, y: 2, z: 0 },
             { x: 3, y: 3, z: 0 },
             { x: 9, y: 4, z: 0 },
           ],
           color: getColor("ROSE"),
           showPoints: true,
           labels: [
             { text: "(1, 2)", at: 2, offset: [0, 1, 0] },
             { text: "(3, 3)", at: 3, offset: [0, 0.5, 0] },
           ],
         },
         {
           points: [
             { x: -0.5, y: 2, z: 0 },
             { x: 10, y: 2, z: 0 },
           ],
           color: getColor("PURPLE"),
           labels: [{ text: "y = 2", at: 0, offset: [-0.5, 0.3, 0] }],
           showPoints: false,
         },
         {
           points: [
             { x: 0, y: -2, z: 0 },
             { x: 0, y: 5, z: 0 },
           ],
           color: getColor("PURPLE"),
           labels: [{ text: "x = 0 (asymptote)", at: 1, offset: [0.5, 0, 0] }],
           showPoints: false,
         },
       ]}
       cameraPosition={[0, 0, 15]}
       showZAxis={false}
     />
   </ContentBlock>

Visible text: 1. Value tables:

 For :
 | | | | | | |
 |-------------------------|-------------------------------------|------------------------------------|----|----|----|
 | | | | | | |

 For :
 | | | | | | |
 |-------------------------|-------------------------------------|------------------------------------|----|----|----|
 | | | | | | |

2. For :

 - Domain: 
 - Range: All real numbers
 - Vertical asymptote: 

3. For :

 - Shift: to the right
 - Domain: 

4. For :

 - Graph shifted up
 - There is no -intercept because the domain is 

 <ContentBlock>
 <LineEquation
 title={
 <>
 Sketch of Graph 
 </>
 }
 description={
 <>
 Logarithmic graph base shifted up.
 </>
 }
 data={[
 {
 points: Array.from({ length: 100 }, (_, i) => {
 const x = (i / 99) * 10 + 0.01;
 return { x, y: Math.log(x) / Math.log(3), z: 0 };
 }),
 color: getColor("PURPLE"),
 labels: [{ text: "y = log₃ x", at: 40, offset: [0.5, -0.5, 0] }],
 showPoints: false,
 },
 {
 points: Array.from({ length: 100 }, (_, i) => {
 const x = (i / 99) * 10 + 0.01;
 return { x, y: Math.log(x) / Math.log(3) + 2, z: 0 };
 }),
 color: getColor("EMERALD"),
 labels: [{ text: "y = log₃ x + 2", at: 50, offset: [0.5, 1, 0] }],
 showPoints: false,
 },
 {
 points: [
 { x: 1 / 9, y: Math.log(1 / 9) / Math.log(3) + 2, z: 0 },
 { x: 1 / 3, y: Math.log(1 / 3) / Math.log(3) + 2, z: 0 },
 { x: 1, y: 2, z: 0 },
 { x: 3, y: 3, z: 0 },
 { x: 9, y: 4, z: 0 },
 ],
 color: getColor("ROSE"),
 showPoints: true,
 labels: [
 { text: "(1, 2)", at: 2, offset: [0, 1, 0] },
 { text: "(3, 3)", at: 3, offset: [0, 0.5, 0] },
 ],
 },
 {
 points: [
 { x: -0.5, y: 2, z: 0 },
 { x: 10, y: 2, z: 0 },
 ],
 color: getColor("PURPLE"),
 labels: [{ text: "y = 2", at: 0, offset: [-0.5, 0.3, 0] }],
 showPoints: false,
 },
 {
 points: [
 { x: 0, y: -2, z: 0 },
 { x: 0, y: 5, z: 0 },
 ],
 color: getColor("PURPLE"),
 labels: [{ text: "x = 0 (asymptote)", at: 1, offset: [0.5, 0, 0] }],
 showPoints: false,
 },
 ]}
 cameraPosition={[0, 0, 15]}
 showZAxis={false}
 />
 </ContentBlock>