You already know about numerical functions and have just visited the topic of exponential functions. In this topic, we will concentrate on another kind of numerical function – logarithmic functions. These functions are strongly related to exponential functions, and you will see how. Logarithms are widely used in math and computer science. For example, to find the minimal length of the letter A binary code, you need to take a binary logarithm of the alphabet size. We will get the intuition behind logarithms, plot logarithmic functions, and discuss their main properties.
Logarithmic growth
Let's revisit the example of our lucky investment. You have invested in a project and earn of profit every day. As you know, exponential functions help solve the task of finding how much money you will have on day – as many as dollars. You might remember that even though initially our money is low, it grows very fast.
Now let's solve the opposite task: find out how many days you need to wait to obtain, say, (or more, since the sums are unlikely to be integers). Surprisingly, you need to wait for only 38 days.
The thing that allows us to calculate this is the logarithm. It is defined as follows:
By definition, is the power to which we need to raise to get .
Logarithmic function
Let's define a logarithmic function:
The function outputs to which power you need to raise a constant , the base of the logarithm, to get an argument .
Now let's apply this new knowledge to the investment example. Every day the sum is multiplied by , so you are going to have dollars on your account on day , which makes the number of days depend logarithmically on the account money:
As you can see, logarithmic functions are rather handy. In our toy example, though, the number of days cannot be fractional or negative, while the codomain of logarithmic functions is .
Specific logarithm bases are widely used, so these logarithms acquired special notation.
Logarithm with base is commonly known as .
Logarithm with base , an irrational constant you remember from the topic about exponential functions, is typically called the natural logarithm and written as (or simply , in many programming languages).
Change of base
Logarithms have a remarkable property known as change of base. The formula below demonstrates how to change the logarithm base:
This formula also has a significant special case when you want to swap and :
By this formula, two logarithmic functions with different bases are linked by a constant:
Logarithm rules
Logarithm rules can help you simplify really complex mathematical expressions containing logarithms. Let's learn them!
The first one is the product rule. It states that the logarithm of the product is the sum of the logarithms of the factors:
Here's an example of its application. Imagine that you are solving an equation, and one of the terms is . Can you simplify this term? Of course, you can!
After such simplification, it is much easier to solve the equation.
The second rule is the quotient rule. It states that the logarithm of the ratio of two quantities is the logarithm of the numerator minus the logarithm of the denominator:
Let's apply this rule to simplify the following expression: .
Now let's move on to the last rule, the power rule. It states that the logarithm of an exponential number equals the exponent multiplied by the logarithm of the base:
This rule is also useful for simplification of complex expressions. For example:
Why are the Logarithm rules like this? It is due to their connection to the properties of the exponential function. These proofs are not that easy, so we won't discuss them in our topic.
Plots
Now you are ready to move on to the plots. The following figure shows two examples of logarithmic functions with bases greater than .
As you can see, both functions are strictly increasing. Besides, the nature of growth depends on the base: when , the red function values are greater, but when passes , the yellow function is in the lead. The latter is very intuitive because powers of grow much faster and reach higher values sooner than powers of 2.
In the following figure, there are two more examples of logarithmic functions, now with bases less than .
Here both functions are strictly decreasing. It is easy to notice that these functions are similar to the ones in the previous figure but vertically flipped. Let's see why:
As you can see, change of base works. It also makes functions like to be vertically flipped versions of .
Properties
Now that you have seen several examples, let's formulate the main properties of logarithmic functions.
A logarithmic function is strictly increasing if , and strictly decreasing if .
The domain of all logarithmic functions is . Indeed, since the base is positive, the result of exponentiation (which is in case of logarithmic functions) can be neither negative nor .
The codomain of all logarithmic functions is .
Any logarithmic function is unbounded below and above.
Logarithmic functions are not symmetrical, thus being neither even nor odd.
You may have noticed that plots and properties of logarithmic functions are somehow related to those of exponential functions. Indeed, these functions are inverse to each other:
Therefore, the properties of logarithmic functions are inverse to those of exponential functions, and the plots of and are symmetrical about the line .
Conclusion
In this topic, you have gone through logarithmic functions and understood the logic behind them and their main properties. Now you know that:
Logarithmic functions are inverse to exponential functions, so their properties are inverse to those of exponential functions.
Logarithmic functions have very different plots and properties depending on : they are strictly increasing if , and strictly decreasing if .
Two logarithmic functions with different bases differ only by a constant coefficient.
There are three main logarithm rules: the product rule, the quotient rule and the power rule
You have also learned some peculiar properties of logarithms, such as change of base and dependency between and .