# Find Logarithmic Function Given its Graph

## Logarithmic Functions of the General Form

Find a possible equation of a logarithmic function , given its graph, of the form $f(x) = a \log_b (x - c ) + d$

A preparation for the examples below would be to work through the tutorial on graphs of logarithmic functions to explore and study the properties of the graphs of logarithmic functions.
Some of the most important properties of the logarithmic function are the domain, range and vertical asymptote if any.
The argument of a log must be positive. Hence, the domain of function $f$ defined $f(x) = a \log_b (x - c ) + d$ is found by solving the inequality
$x - c \gt 0$ ,
The range is given by the interval
$(-\infty , \infty )$
The vertical asymptote is found by solving the equation
$x - c = 0$
We also review the relationship between the exponential and logarithmic functions which is used to convert logarithms and exponentials expressions.
$y = b^x \iff x = \log_b y$

## Examples with Detailed Solutions

Example 1
Find the logarithmic function of the form $y = \log_b (x)$ whose graph is shown below.

Solution to Example 1
The point $(3,1)$ is on the graph of the function. Substitute $x$ and $y$ by their values in the equation $y = \log_b (x)$ to obtain
$1 = \log_b (3)$
Rewrite the logarithmic expression above into an exponential expression to obtain
$b^1 = 3$ or $b = 3$
The function whose graph is shown above may be written as
$y = \log_3(x)$

Example 2
Find the logarithmic function of the form $y = \log_b (x-c)$ whose graph is shown below.

Solution to Example 2
From the graph, we note that for $x = -1$, $y = 0$ and for $x = 2$, $y = 2$. Substitute $x$ and $y$ by their values in the logarithmic function $y = \log_b (x-c)$ to obtain two equations
$0 = \log_b (-1-c) \; \;$ (equation 1)
and
$2 = \log_b (2-c) \; \;$ (equation 2)
Equation (1) may be written in exponential form as
$b^0 = -1- c$
$b^0 = 1$, hence c is given by
$c = - 2$
Substitute $c$ by $- 2$ in equation (2) to obtain
$2 = \log_b (2-(-2))$ or $2 = \log_b (4)$
Rewrite the above logarithmic expression into an exponential form
$b^2 = 4 = 2^2$
$b$ is the base and must be positive. The solution to the above exponential equation is
$b = 2$
The logarithmic function whose graph is shown above may be written as
$y = \log_2(x + 2)$

Example 3
Find the logarithmic function of the form $y = a \log_4(x-c)$ whose graph is shown below.

Solution to Example 3
The points $(-1,0)$ and $(2,3)$ are on the given graph. Hence the two equations
$a \log_4(-1-c) = 0 \; \;$ (equation 1)
and
$a \log_4(2-c)= 3 \; \;$ (equation 2)
Divide both sides of equation (1) by $a$ to obtain
$\log_4(-1-c) = 0 \; \;$ (equation 1')
and the above equation may be written in exponential form as follows
$4^0 = - 1 - c$
which gives
$c = - 2$
Substitute $c$ by $-2$ in equation (2) to obtain
$a \log_4(2-(-2))= 3$
Divide both sides by $a$ to obtain
$\log_4(4) = 3/a$
Since $\log_4(4) = 1$, the above equation may be written as
$1 = 3/a$
which gives
$a = 3$
The logarithmic function whose graph is shown above is given by
$y = 3 \log_4(x+2)$ \)

Example 4
Find the logarithmic function of the form $y = a \log_2(x -c)+d$ whose graph is shown below with a vertical asymptote (red) given by $x = 1$.

Solution to Example 4
The vertical asymptote is given by the solution to the equation
$x - c = 0$
which gives
$x = c$
The vertical asymptote is given by $x = 1$. Hence
$c = 1$
From the graph, we note that for $x = 5$ $y = 0$ and for $x = 9$ $y = 2$ . Hence the equations
$0 = a \log_2(5 - 1) + d \;\;$ (equation 1)
$2 = a \log_2(9 - 1) + d \;\;$ (equation 2)
Note that
in equation (1) we can make the simplification: $\;\; \log_2(5 - 1) = \log_2 4 = \log_2 2^2 = 2$
in equation (2) we can make the simplification: $\;\; \log_2(9 - 1) = \log_2 8 = \log_2 2^3 = 3$
We use the above to rewrite equations (1) and (2) as
$0 = 2 a + d \;\;$ (equation 1')
$2 = 3 a + d \;\;$ (equation 2')
Solve the above equations simultaneously to obtain
$a = 2$ and $d = -4$
The logarithmic function whose graph may be written as
$y = 2 log_2(x-1)-4$

Example 5
Find the logarithmic function of the form $y = a \log_2(x - c) + d$ whose graph is shown below with a vertical asymptote (red) given by $x = 0$.

Solution to Example 5
The vertical asymptote of the logarithmic function $y = a \log_2(x - c) + d$ is given by $x = c$, hence
$c = 0$
From the graph, we note that for $x = 2$ $y = - 5$ and for $x = 4$ $y = - 6$ . Hence the equations
$a \log_2(2) + d = - 5 \;\;$ (equation 1)
$a \log_2(4) + d = - 6 \;\;$ (equation 2)
Simplify the above ( using $log_2(2) = 1 , \log_2(4) = 2$ ) to obtain the equations
$a + d = - 5 \;\;$ (equation 1')
$2 a + d = - 6 \;\;$ (equation 2')
Solve simultaneously the above equations to obtain
$a = - 1$ and $d = - 4$
The logarithmic function whose graph is shown above is given by
$y = - \log_2(x)-4$

Find the logarithmic functions (A), (B) and (C) of each graph shown below. The broken line is the asymptote of the graph with the same color.

1. (A): $y = log_{1/2}(x)$
2. (B): $y = -2 \log_3(x-2)$
3. (C): $y = 3 \log_2(x+2) - 2$