Let's continue our study of derivatives as functions, but before we do, let's do a little warm up, let's get some practice going here. Let's give you a nice rational function. How about 3 minus x over five plus x? Find the derivative but not at a certain number, I want it actually as a function. Find f prime of x. That's how you read this. We're going to use the limits definition to do this. Remember, write the definition down, just wanted to see lots of examples with this. Limit as h goes to 0 of f of x plus h, we're doing it in the generic function form minus f of x all over h. Don't forget to write the limit, oh, I forgot to write the limit, shoot, I got to go fix that. Limit as h goes 0. Write the limit every time. Do I have to write limit every time? Yes, you have to write the limit every time. Evaluate the function at x plus h. What does that mean? Every time I see an x, I'm going to put in parentheses. Don't forget parentheses. X plus h, 5 plus, parenthesis, x plus h. Minus the original function, so 3 minus x over 5 plus x all over h. To save space, I'm going to write it like this, divided by h on the right side. This is a gross fraction, so what do we do with gross fractions? We clean them up. I could distribute this thing if I wanted to, maybe it's not a bad idea, but let's do some Bow-Tie methods. So I'll do bottom right, 5 plus x times 3 minus x minus h. I'm combining fractions, so top right times bottom left minus the top right times the bottom left 5 plus x plus h all over the bottoms multiplied together. So, 5 plus x plus h over 5 plus x. All of this is divided by h, so h hangs out downstairs in the denominator so we'll put it right there. This is how you combine fractions. Again, I'm doing some algebra. This is called the Bow-Tie method to add fractions. If you haven't seen that, you can look that up. Otherwise, however you were taught to add fractions, do it your way, you do you. Now, I'm hoping that after a bunch of Algebra and simplifications, a lot of stuff will cancel. This is good practice of algebra. If I have 5 plus x times 3 minus x minus h, what do you do here? We multiply the x in and then we'll multiply the five in. Remember how to multiply polynomials. Let's do the five first, you get 15 minus 5x minus 5h and it comes the x plus 3 to the x minus x squared minus x_h. These have to be combined, but we'll do that next and then let's do minus, we'll send a three across. We get 15 plus 3x plus 3h. Now we'll send in the minus x to all the terms, minus 5x, minus x squared, minus x_h. All that is over, this is the biggest fraction on the planet, 5 plus x plus h, 5 plus x over h. All right, keep going, we're having so much fun. So limit as h goes to zero, what's going to cancel? 15 minus 15 will cancel. I have minus 5x right there and I have a minus minus 5x, which is a plus 5, so that'll actually cancel as well. 5h, I don't see another five h anywhere, so there's not much going to happen there, but I have a minus 3h. So, it's going to be minus 5h, minus 3h is minus eight h. 3x, oh good, that'll cancel. I have a positive 3x here and then a minus 3x after bringing the minus sign there. X squared, same thing. I have a minus x squared and a minus minus x squared, that'll cancel. So, a lot is canceling, that's promising. Then I have a minus 8x minus, try again, minus x_h minus minus x_h, that cancels as well. The numerator, although is kind of gross, it cleaned up quite nice. Just minus 8h and then that h is going to be canceled with the h on the bottom. We don't combine the denominator because we're hoping stuff to cancel there and these hs cancel. Now I have a nice rational function. The multiplication by h on the bottom was the problem why I couldn't plug-in, so that is no longer a problem. Now let's go ahead and plug in and you get minus 8 over 5 plus x plus 0 times 5 plus x. So to evaluate the limit, I can just plug in here and that is probably better known as minus 8 over 5 plus x squared. This is our answer, this is the function and at any value of x, I can plug in. So, it's a function, I could graph it. It's going to look different than the original function. I guess I can pass it up, make it all pretty. A couple of things about it, it has a domain. Let's compare domains for a minute. The domain of the original function is going to be x not equal to 5 or let's say, x not equal to negative 5 Don't want to divide by zero and down here as well, that's also a case. This is a coincidence that they happen to have the same domain. There are cases when they do not have to have the same domain as well, so this is the domain of this function. You can graph this function and I can ask you anything, any traditional question about functions here. Here's a crazy example that cleans up nice, good algebra practice if you haven't seen it before. Go over this one if you need to. In the meantime, let's move on to some other notations. If we have the derivative, that turns out you can write it in a bunch of ways. Let's consider y equals f of x as a function, then the derivative, and this is for historical reasons and because it's used in different contexts. They say calculus was invented or discovered by Newton who wrote his book and uses his notation, then there's this guy Gottfried Leibniz over in Germany, who has his notation. You can write it as, this how Newton wrote it, f prime of x. We've been using this, it's nice and easy to write f prime. You can also write this as y prime, there's nothing wrong with that, you'll see it both ways. This is the Newton way to write it with the primes. Labyrinths wrote dy dx when he did his notation, and you can also replace y with ddx. It turns out there's a time and a place when both of these have their uses. So one is not better or worse than the other, other books write it as capital D. You can also see it as D_x, sub x of f of x. There is no better or worse way to do it, just know that you're going to see any one of these notations and I'll keep calling out what they're called. In addition to having different notations, they also remember go by other names. It says you have the derivative, I can say the derivative f prime of x, that's fine. We can also say instantaneous rate of change. Instantaneous rate of change, and I can call it y-prime or any other notation. I can call it the slope of the tangent line, if I'm talking about geometry or what some of the mathy stuff, slope of the tangent line, and I can use dy dx. If remember for Econ or Physics, they have their own names. The velocity, if the function represents the position function, you get the derivative of the velocity, and then in Econ, anything with the word marginal, marginal cost, marginal revenue, marginal profit, whatever that is, that's part of it there too. So different names, different notations, and that's almost like as a complement to the derivative, just how useful it is in all these other disciplines that everyone has adopted it as their own. Now let's talk about the relationship between differentiability and continuity. They both have their own definitions, they both involve limits, so the question is, are they related? Let me ask you this, we'll start off with a true-false question. True or false, every piecewise function is discontinuous. Think about that for a second, let that sink in, think about it. Then true or false, every piecewise function is differentiable. This will help us to start thinking about the relationship between continuous and differentiability. Remember, discontinuous means not continuous. Pause the video if you want to think about some of these answers, but otherwise, let's talk about the solution, ready? Every piecewise function is discontinuous, that is super false. You can get fancy piecewise functions, as you can get simple piecewise functions. As an example, how about the absolute value of x. This one is a true piecewise function. Remember, if I'm greater than 0, I don't do anything. I'm the identity function, just return x. If I'm negative, I have to get rid of my negative so I negate the negative. This function is one of those you should picture in your mind. It is the v, we call that corner or cusp. It is continuous, it's a piecewise function, but it's perfectly continuous. I can draw this graph without picking up my pencil, it has all the properties of a continuous function. Now, every piecewise function is differentiable, that's also false. As an example, you can use the absolute value again, there are lots of examples. If you didn't pick the absolute value, you can do it wherever you want it. This piecewise function which is continuous, let's think about what this is. What's the derivative of this function? Because the function is piecewise, the derivative itself is probably going to be piecewise. You can look at the graph, and we can do this without having to go through the limit definition. This line on the right where it's positive is y equals x, and the line on the left is y equals negative x, so the derivative represents the slope of the tangent line, and when you're align you're your own tangent line, so the slope of the function. The derivative of this function is y equals x, that's what's the slope of that line. It's one, 1x is positive, and the slope of the line 1x is negative is negative one, 1x is negative. At 0, at this cusp, you have a problem. F prime of zero is undefined or does not exist, maybe we should say DNE as a derivative. Why? Because as I approach from the right, the limit or the difference for the derivative is one, and I approach from the left, the derivative is negative one. Remember in a limit, it really means a two-sided limit. You can't differ if you come in from the left and come in from the right. At one, at zero sorry, the derivative is different from the right and the left, it's one or negative one, so this doesn't exist. Here's the function actually just to go back to we talked about before, the domain of the original function is all reals, but the domain of the derivative is all reals except zero. Here's a example where the function and its derivative have different domain. There is a relationship, there is not either like what is it we got to figure that out, this we're going to work on in this section. But this is an example where every piecewise function certainly can be discontinuous or continuous, doesn't matter. There's some that are either one, and then piecewise functions can be differentiable if you connect them in a nice way where the graphs are smooth. Differentiability usually means smooth, no sharp corners, no cusps. So cusps are bad. But this example is one that breaks this true false. Let's actually get into the relationship. That's going to be a theorem. Here's the relationship, here's the theorem. One will imply the other, but not vice versa. So if a function, if f is differentiable at X equals a, so at some point the derivative exists as a limit. Then it must be continuous there. So then f of a is continuous. It's continuous at a. The main idea of all this is that differentiability implies continuity. Here's my abbreviation. If I'm differentiable, then I'm continuous. But the converse is false, so I'll put that in red. The converse is false. Continuity, if I'm continuous, it does not imply differentiability. As an example is one we just saw, the absolute value of X will do that. It's a one-way street, like if it rains, then I bring an umbrella. But if I bring an umbrella, doesn't mean it's going to rain. One will imply the other, but not vice versa. We say the converse isn't true. Okay, so let's prove this, let's just see why this is true. I'll do this in red if I can change the color. Let's go through this here. Let's assume that f prime exists. So f is differentiable at a means that f prime of a exists. This is some number, it's a real number, it's not a DNE. I can actually use this symbol and play around with it, it's some number. In particular, if I take this number, as a real number, it's not like abstract expression, and multiply by zero. Hopefully you all agree, that this is zero. Now this is funny because if I'd just written this down, you may have been like, of course, anything times zero is zero, but you got to be careful to say anything is any number and so I needed it to actually exist. That's why this condition that f is differentiable is super-important, for this first-line to make any sense. Now what I want to do is replace zero, I need to introduce limits somewhere. Differentiability and continuity, they're all about limits so therefore, let's talk about f prime of a. I want to write zero as a limit. What's a nice way to do that? How about the limit as x goes to a, of x minus a, we're good enough for limit. At this point to realize that I can just plug in, you'll get a minus a, that is zero. I'm going to write zero in a fancy way using limits. Now I want to use the limit definition of the derivative. So let's write this as the limit, as x goes to a of, I'm going to use the version number 2, f of x minus f of a, over x minus a, to replace my derivative, times the limit as x goes to a, of x minus a. I'm putting limits in everywhere. Since both terms exist, again, that's why I need differentiability, I can bring the limit outside and then the two x minus a's will cancel. I can write this as a single limit, and then the x minus a's will cancel and I'm left with just f of x, minus, f of a, equals zero. Bring the limit outside and cancel the two x minus a's, and then move that over. This is playing around with limits here. Add f of a to both sides, a is in the domain of the function, so this is all defined, and I'm here. All right let this sink in for a second, what are you looking at? Do you realize what you're looking at? The limit as x goes to a, [inaudible] this is the definition of continuity. You just showed that if I'm differentiable, then the function is continuous. This is important, you're going to need this. If you didn't recognize that this was the definition of continuity at a point, add that to your list of things to know for that. So start with that and just realize that one implies the other. Okay. That's the big takeaway from this one. Go through these steps and then we'll use this and talk more about what the implications of this theorem are in the next video. All right, see you then.