 In our previous video, we learned that if we wanna take the derivative with respect to x of the natural log of x, this is gonna equal one over x. But it's important to remember that the natural log of x has a restricted domain. The domain of the natural log of x is just gonna be zero to infinity where zero is not included. And the reason for that is that the natural log or in fact the log base anything, right? Log base A of zero is not defined. So D and E in that situation. Why is that? Well, when you look at the graph of a logarithm as x approaches zero from the right, the log base x is actually gonna have a vertical asymptote. The graph's gonna approach negative infinity. And I suppose I'm assuming in this situation that A is some number greater than one. You would get something like this. In contrast, if A was less than one, still positive, right? So you take something like between zero and one, like one half or one third or whatever. In that situation, if you take the limit as x approaches zero from the right, the log base A of x, that's actually gonna equal positive infinity in that situation. But the important thing to mention here is that whatever type of logarithm you have at the y-axis, you'll have a vertical asymptote. So there's no way of repairing the missing number log of zero inside the domain. You can't repair it because it would have to be a positive or negative infinity, which that's done a real number, no hope there. But what about negative numbers? Like, can we talk about the natural log of negative one or something like that? Well, I mean, we can. It does technically lead towards some imaginary numbers. For example, the natural log of negative one is equal to pi times I, which I don't wanna give too much of an explanation to this video of why that is. But it's kind of like the same issue when you take the square root of a negative, you're gonna end up with imaginary numbers. Same thing happens with logarithms of negatives. But what you could do, I mean, if we wanted to extend the domain of the natural log, we could instead of using the natural log, we could consider the function, the natural log of the absolute value of X. Notice the difference here is that by taking the absolute value of the input value, if it was negative, it'll swap to positive and then you take the natural log of it normally. So when X is positive, these two things are actually one in the same function. But when X is negative, this will be undefined as a real number, but this will just be a mirror image of what you see over here. So we can properly extend the domain. So, thinking about this, for example, the natural log of X, its domain, like we mentioned, is zero to infinity. But on the other hand, if we take the natural log of the absolute value of X, its domain is going to be negative infinity to zero, union zero to infinity. So it is possible to extend the domain to be all real numbers except for zero. Well, why is that so significant? Well, let's come up to the function one over X for a moment. What's the domain of this function? Well, by the domain convention, we can't have X equals zero because you divide by zero, but it's defined for everything else. So we would get that negative infinity to zero, union zero to infinity would be the domain of one over X. So when it comes to a function and its derivative, the derivative's domain can never be larger than the original function because the derivative is only defined for slopes of tangent lines that are defined. If you're outside the domain, you can't have a tangent line there that the derivative would be undefined. So when you take the derivative of the natural log, even though the formula is one over X, its domain would normally have to be positive X. But if we wanna get the full breadth of its domain, we could potentially extend the natural log's domain as well. And so what we will see in fact is that the derivative of the natural log of the absolute value of X is equal to one over X. The derivative doesn't change when you extend its domain in this manner. This will also be true if you use a different log base. Like log base A of the absolute value of X will still be one over the natural log of A times X. So let me explain where this one comes from. Why does extending the domain not affect things here? And the reason is essentially the following. If you take the natural log of the absolute value of X, we can treat this like a piecewise function. For when X is greater than zero, it's no different than the natural log of X. But when X is less than zero, if the number is negative, then if you times a negative by a negative one, that'll actually make it positive. So this function will behave like the natural log of negative X. For which case then when you take the derivative, so the derivative d dx of the natural log of the absolute value of X, what this is gonna look like using these same domains is we're gonna take the derivative of the natural log of X when X is greater than zero. We know that's gonna be one over X. But when X is less than zero, we have to take the derivative of the natural log of negative X, like so. How does that one work? Well, by the chain rule, what you're gonna see here is you're gonna get a negative one over negative X. Where does that come from? Well, specifically here, this looks like negative X prime over negative X. When you take the derivative of a natural log, so the derivative d dx of the natural log of some function say U, where U is a function of X here, the derivative is always gonna look like U prime over U using the chain rule. And so that's exactly what we see right here. But what's the derivative of negative X? That's gonna be a negative one, like we mentioned a moment ago. So you get negative one over negative X, which simplifies just to be one over X. And so that verifies our formula that the derivative of the natural log of X is still one over X. We can expand the domain and retain the original derivative as well. So if you see things like the natural log with an absolute value inside of it, we have to calculate the derivative of that. That actually doesn't complicate the situation whatsoever. Let me show you an example. So let's find the derivative of each of the following. Let's take Y to equal the natural log of the absolute value of 5X. What's the derivative here? What's Y prime? So we have to take the derivative of the natural log of the absolute value of 5X. The fact that we have an absolute value does not actually change the formula, which we're asked to compute. What it changes is the domain, which we often aren't asked to observe what it is in these types of exercises. So therefore, we're gonna take the derivative of 5X, which is a five, and we're gonna divide that by a 5X. So in general here, what you're gonna see is just like the natural log, if you take the derivative with respect to X of the natural log of the absolute value of U, its derivative will look like U prime over U, just with a larger domain here. The five on top cancels the five on bottom and we end up with one over X. Or of course, the domain here is gonna be all real numbers except for zero. Having the absolute value didn't really frustrate anything in the calculation. Let me give you another example. Let's take the natural log, or excuse me, take F of X to equal 3X times the natural log of X squared. Well, recognizing that we have a product of two functions, we have a 3X and a natural log of the absolute value of X squared, we can use the product rule to compute the derivative here. We're gonna get that F prime here equals 3X prime times the natural log of the absolute value of X squared. And then you're gonna add to that 3X times the derivative of the natural log of the absolute value of X squared, like so. The derivative of 3X is gonna be a three. So you get three times the natural log of the absolute value of X squared. And then with the second piece, because you have the absolute value inside the logarithm, whoop-de-doo, it's still gonna be a 2X over X squared. Where does this thing come from, of course? The X squared was the original function on the inside and then the 2X is the derivative of X squared which goes in the numerator. Simplifying a little bit, you have an X that cancels here, you have an X that cancels here. And so we can rewrite this as three times the natural log of the absolute value of X squared, plus in this case, three times two, which is a six, given us the final derivative. If you wanted to, I should also mention that this question had absolute value, but it turns out it makes no difference whatsoever because a quantity X squared, as long as X is a real number, X squared is always even greater than equal to zero. So the absolute value of X squared is actually equal to X squared. So surprise, the absolute value didn't even do anything. You end up with three times the natural log of X squared. You know, we could've, in this case, we could've dropped the natural log. We can't do that in general, but the point I'm trying to illustrate here is that including the natural log inside of the logarithm makes no bit of a difference in terms of computing the derivative. You could also bring the coefficient inside if you were so inclined to do so and see that the derivative would be the natural log of X to the sixth plus six, like so. So we do care about absolute values. When inside of a logarithm though, and you take the derivative, the absolute value will not affect the formula we compute for the derivative. It just expands the domain to be larger than originally assumed.