From the course: Complete Guide to Calculus Foundations for Data Science
Exponential and logarithmic functions
From the course: Complete Guide to Calculus Foundations for Data Science
Exponential and logarithmic functions
- [Instructor] Let's wrap up with exponential and logarithmic functions. Let's start by exploring exponential functions, and then you will learn about logarithmic functions. The reason why you are learning about these two functions together is because they are very connected. Let's get started. Exponential functions are functions where you have a constant real number raised to a variable power. This is defined for real numbers. The form an exponential function takes is f of x equals b to the x. Note that this is for values of b greater than zero, and where b is not equal to one. In this function, b is referred to as the base, and x is referred to as the exponent. Let's explore why b needs to be greater than zero and not equal to one. If b equals zero or b equals one, then you will actually have a constant function instead of an exponential function. And if you have a negative b value, then it will provide inconsistent results. Let's look at an example of why negative numbers are not included in exponential functions. Let's say you have b equal to negative nine. So, using your exponential function format of f of x equals b to the x, you'll then substitute in your value of b equals negative nine two f of x equals negative nine to the x. Now, let's say you want to plug in the power x equals three, so if you take f of three, this will equal negative nine to the three, which equals 729. This works fine, but what if you take x equals 0.5? If you take f of 0.5, this is equal to negative nine to the 0.5, and this is the same as saying it is equal to the square root of negative nine. This is equal to three multiplied by i, where i is an imaginary number. This ends up giving you a result that contains complex numbers instead of real numbers, and that will not work for exponential functions. Here are a few examples of what exponential functions look like, along with a graph of an exponential function. So you have f of x equals five to the x, you have f of x equals three to the x, and you have f of x equals e to the two multiplied by x. Note that the e will be explained later on. And then, to the right, you'll see the graph of an exponential function, where you slowly have the graph coming from the left and then quickly going up on the right side. Something to note when it comes to dealing with powers is that a power function is not the same thing as an exponential function. So a power function is notated as f of x equals x to the b, where, in this case, you have your variable x as the base, and then your variable b as the exponent. This is because power functions have that variable raised to a fixed power. This is not the same as exponential functions, where you are raising a fixed value to a variable power. Let's review some common properties for exponential functions. First, the base of the function, b, must be greater than zero and must not equal one. If x is equal to zero, then the function will always equal one. Three, the domain is defined for all real numbers. Four, the range is defined for all positive real numbers. Next, if b is greater than zero but less than one, then f of x will approach zero as x approaches infinity, and f of x will approach infinity as x approaches negative infinity. Now, if b is greater than one, then f of x will approach infinity as x approaches infinity, and f of x will approach zero as x approaches negative infinity. There are various properties for exponents that are often referred to as the laws of exponents. These will help you simplify expressions that contain exponents with your exponential functions. So, first you have the law of product, which is b to the x multiplied by b to the y equals b to the x plus y. So essentially if you multiply two exponential functions, you can then just add their powers together. Next, you have law of quotient, so if you have b of x divided by b of y, this will equal b to the x minus y, so essentially the opposite of the law of product. Next, you have the law of power of a power, so if you have b to the x, and then that is to the y, this will then equal b to the x multiplied by y. Then you have law of power of a product, where you have a multiplied by b, and then both of those are to the x. This will equal a to the x multiplied by b to the x, where essentially you're distributing that x value between those two different values of a and b. Next, you have Law of power of a quotient, where you have a divided by b, and that is taken all to the x. This will equal a to the x divided by b to the x, again distributing that exponent. And finally, you have the Law of negative exponent, where you have b to the negative x equals one divided by b to the x. So note that, with this last one, sometimes I will notate throughout this course exponential functions in that b to the minus x format, and other times, I will notate it in the one over b to the x format. There's a special type of exponential function that appears in many real world applications. This is called the natural exponential function. This function is represented by f of x equals e to the x, where e is what is called Euler's number, and it's approximately to 2.7183. So this is similar to how Pi is a number that is often used in mathematics, Euler's number is another one that is great to know. Since e is greater than one, as x approaches infinity, so does the function f of x. Now that you have a general understanding of exponential functions, let's take a look at logarithmic functions. Logarithmic functions are functions where you have a variable that represents the exponent needed to produce a given number from a constant real base. This is defined for real numbers. Logarithmic functions take the form of y equals log base b of x, so you'll note that the b is slightly lower as an index next to that log, and that log stands for logarithm, and this will be for values of b greater than zero and not equal to one. Note that this is equivalent to x equals b to the y. You'll still have your base be notated as b. And if b is equal to zero, or b is equal to one, then it is a constant function. Note that negative b values also provide inconsistent results, hence why they are not used in these types of functions. So how are exponential functions and logarithmic functions related? Logarithmic functions are essentially the inverse of exponential functions. Since this is the case, then the following is true, where you have the log of base b of b to the x equals x, which equals b to the log base b of x. So, essentially, the exponential functions and the logarithmic functions cancel each other out. Let's look at some examples of logarithmic functions along with the graph. Here, you have f of x equals log base 10 of x. Then you have f of x equals ln of x, which, I will explain in a few slides what that ln means. And then you have f of x equals log base seven of x to the four divided by y. To the right, you'll see you have a logarithmic function. It looks similar in shape to your exponential function, but it's coming in from a different direction, where it's coming in from the bottom and going straight up, and then it finally ends up starting to curve over to the right and slowly decreases the amount that the function is going towards the positive direction of y. Let's review some common properties for logarithmic functions. First, the base, b, must be greater than zero, and b must not equal one. If x equals one, then the function will always equal zero. Three, the domain is defined for all positive real numbers. Four, the range is defined for all real numbers. So you'll notice the domain and range essentially flip, as far as what they're defined for with exponents and logarithms. Number five, logarithms are the inverse of exponential functions where you have log base b of b to the x equals x, which equals b to the log base b of x. Six, if b is greater than zero and less than one, then f of x will approach negative infinity as x approaches infinity, and f of x will approach infinity as x approaches zero. And finally, if b is greater than one, then f of x will approach infinity as x approaches infinity, and f of x will approach negative infinity as x approaches zero. Let's look at some key logarithmic properties that will help you simplify your logarithmic expressions as you work with them throughout this course. First, you have the same base rule, and this is log base b of b is equal to one, so essentially if you have the same base as the value inside of those parentheses, it'll then just equal one. Next, you have the product rule, where you have log base b of x multiplied by y equals log base b of x plus log base b of y. Next, you have the quotient rule, where you have log base b of x divided by y equals log base b of x minus log base b of y. So you note for the product and quotient rules, essentially it changes the operations from multiplication to addition where you separate them out, and then for quotients, it then changes to subtraction. So this is a really great way to separate out variables when dealing with logarithms. Next is the power rule, where if you have log base b of x to the r, this will equal r multiplied by log base b of x. This will be very important when it comes to working with logarithms and those exponential functions, and how you can move that exponent and treat it more as a constant multiple. Finally, you have the change of base rule. There are multiple variations of this rule, but a common version of it is log base a of x equals log base b of x divided by log base b of a. This will help you essentially change the base of the logarithm you are working with. Now let's explore natural logarithms, which are similar to natural exponential functions, where you are using that Euler's number. And note that these appear in many real world applications. So the natural logarithmic function is often notated by that ln of x. So ln of x is often notated as the natural log, or natural logarithm, of x. And this is equal to log base e of x, where essentially the log base e will then just merge to just be that ln. Again, this uses Euler's number, e, which is approximately equal to 2.7183. And since e to the x and the natural log of x are inverse functions, then the natural log of e to the x equals x, which equals e to the natural log of x, so again, they cancel each other out. One of the great things is you can use logarithmic functions and exponential functions to solve each other. Let's see this in action with an example. So let's say you have seven to the x equals five, and you want to solve for the value of x. So you'll take the natural logarithm of both sides of this equation. Note that you could use a different logarithm, but the natural logarithm tends to be one of the easiest ones to work with for these types of situations. So you have the natural log of seven to the x equals natural log of five. Using that power rule, you can then move the exponent out to have it be x multiplied by the natural log of seven equals natural log of five. Then divide both sides by that natural log of seven to get x equals natural log of five divided by natural log of seven, which is approximately equal to 0.827. So this is a great example of how you can use logarithms, and their properties, to solve an exponential function. Now let's go the other direction. So let's say you have the natural log of one divided by x equals 12. If you take both sides to the exponent of Euler's number, e, you'll have e to the natural log of one divided by x equals e to the 12, and this gets you one to the x equals e to the 12. Once you rearrange this, you get x equals one divided by e to the 12, which is approximately equal to 6.14 multiplied by 10 to the negative six, meaning it's a very, very small number. There are many real life applications for both exponential and logarithmic functions. In biology, exponential functions are used to model population growth and decay. In finance, they're used to model compound interest of how money grows over time. In seismology, the Richter scale uses a logarithmic function with the scale to model the magnitude of earthquakes. And finally, in acoustic metrology, logarithmic functions are used to model how loud a sound is in decibels. This should provide you a thorough introduction of both exponential and logarithmic functions, but know that there are many variations of them, as you saw with the natural versions. I highly recommend taking time on your own to continue practicing more problems with exponential and logarithmic functions and see how you can use their various properties to solve them. This wraps up your introduction to calculus and functions, but note that this is just the beginning. I suggest you take time on your own to further explore these common functions, along with some less common functions. In the next chapter, you'll learn all about the first key concept of calculus, limits.