### Video Transcript

Let π of π₯ equal ππ₯ squared plus ππ₯ plus three if π₯ is less than four and one over π₯ minus five if π₯ is greater than or equal to four. If π is differentiable at π₯ equals four, find π and π.

Our function π is piecewise defined with its rule changing at π₯ equals four. And weβre looking for the values of π and π, which make π differentiable at π₯ equals four, where its rule changes. What does it mean for the function π to be differentiable at π₯ equals four? Well, technically, the derivative of π at the number four which is the limit of π of four plus β minus π of four all over β as β approaches zero must exist.

The plan for this video is to start by rigorously finding the values of π and π for which this limit exists. Weβll then see that having done it probably once, we can in the future use a procedure, which is much quicker. And then, weβll have a look at the graph of the function to understand what it means for a piecewise function to be differentiable at the point at which its rule changes.

Okay, so letβs start by finding when this limit exists β that is when the left-hand and right-hand limits exist and are equal. Letβs start with the left-hand limit β the limit as β approaches zero from the left that is with values of zero or less than zero, but getting closer and closer to zero. As β is less than zero, four plus β is less than four. And we know what π of π₯ is if π₯ is less than four, itβs ππ₯ squared plus ππ₯ plus three. So π of four plus β is π times four plus β squared plus π times four plus β plus three.

And how about π of four? Well, when π₯ is greater than or equal to four, π of π₯ is one over π₯ minus five. So π of four is one over four minus five. And having completed the numerator, we write in the denominator β as well. Letβs now simplify the numerator by expanding and distributing. π times four plus β squared becomes πβ squared plus eight πβ plus 16π, π times four plus β becomes four π plus πβ, and three minus one over four minus five is just four.

Inside the limits then, we have a quadratic in β in terms of the numbers π and π that we have to find. Letβs write this more explicitly as a quadratic in β. Having done this, we can split the fraction into three. And we can simplify to these fractions. The first fraction becomes πβ and the second becomes eight π plus π. And we can use the fact that the limit of a sum is the sum of the limit to write this limit as the sum of two limits.

The first of these limits can be evaluated by direct substitution. We just substitute zero for β. This gives π times zero plus eight π plus π, which is of course just eight π plus π. The other limit is a multiple of the reciprocal function one over β as β approaches zero. And we know that this limit is undefined. So what weβre to do? We really want our left-hand limit to be defined. Well, this can still happen if four plus sixteen π plus four π is zero. And it doesnβt matter that the limit is undefined because weβre multiplying it by zero. And weβre just left with eight π plus π.

To rephrase this, for the left-hand limit to exist and hence for the derivative of π at the number four to have any chance of existing, four plus 16π plus four π must be zero. And if this is the case, then the value of the left-hand limit is eight π plus π.

Now that weβve gone as far as we can with the left-hand limit, we need to think about the right-hand limit. Remember that we need this not only to be defined, but also equal to the left-hand limit for the limit period to exist. Weβre now dealing with the right-hand limit. β is now greater than zero, but getting closer and closer to zero. And so four plus β is greater than four. When π₯ is greater than four, π of π₯ is equal to one over π₯ minus five. And so for the right-hand limit, π of four plus β is one over four plus β minus five.

π of four on the other hand hasnβt changed. Itβs still one over four minus five. And we can immediately simplify the numerator because minus one over four minus five is just plus one and four plus β minus five is just β minus one.

To simplify further, we multiply both numerator and denominator by β minus one. And so in the numerator, one over β minus one becomes one and one becomes β minus one. We can cancel the one and minus one and weβre left with just β in the numerator. And the β in the numerator cancels with the factor of β in the denominator, leaving us with just one over β minus one in the limit.

And now, the limits can be evaluated using a direct substitution. We just substitute zero for β and we get one over zero minus one which is one over negative one, which is negative one. So the right-hand limit exists and is equal to negative one.

Now that we have the values of the left-hand and right-hand limits in terms of π and π, we can work out when the limit period exists. For the limit of π of four plus β minus π of four all over β as β approaches zero to exist, both the left-hand and right-hand limits must exist and they must be equal. Weβve seen that for the left-hand limit to exist, four plus 16π plus four π must be zero. Thereβs no such issue with right-hand limit. It exists and its value is negative one.

But for the left-hand and right-hand limits to be equal, eight π plus π must equal negative one. So weβll write that down as well. We therefore have two linear equations and two unknowns π and π. And hopefully, we can solve these equations simultaneously to find the values of π and π.

There are many methods to do this. Iβll choose to rearrange the second equation to write π in terms of π. Subtracting eight π from both sides, we get π equals negative one minus eight π. And now, we can substitute negative one minus eight π for π in the first equation to get an equation which is in terms of π alone.

We distribute and simplify cancelling the fours to find that π is zero and we use this value of π to find the value of π. π is then negative one minus eight times zero, which is negative one. So thatβs our answer. Weβve successfully found the values of π and π which make the function π differentiable at π₯ equals four. We work this out from our first principles using the definition of π being differentiable at π₯ equals four.

Having done this, letβs look at the conditions that we required and see if we could have worked them out without doing so much work. This condition highlighted at four plus 16π plus four π must be zero, which we required for the left-hand limit to exist, comes from the fact that π must be continuous at π₯ equals four. That is that the limit of π of π₯ as π₯ approaches four must be π of four. For a function to be differentiable at a point, it must be continuous at that point.

The other condition that the left-hand limit eight π plus π must equal the right-hand limit negative one comes from the derivatives of the rules of the function π on either side of π₯ equals four. You can check that eight π plus π is the derivative of ππ₯ squared plus ππ₯ plus three at π₯ equals four and negative one is the derivative of one over π₯ minus five at π₯ equals four.

Consider the more general piecewise function π of π₯ is π of π₯ if π₯ is less than π and β of π₯ if π₯ is greater than or equal to π and suppose you want to know if π is differentiable at π₯ equals π. Well, to make things easier for ourselves, letβs assume further that both π and β are differentiable at π₯ equals π. And so the only problem comes from the piecewiseness of π. The answer is yes if π of π is equal to β of π and the derivative of π at π is equal to the derivative of β at π. The first condition π of π equals β of π ensures that π is continuous at π₯ equals π. And not only the values of the functions π and π must agree at π₯ equals π, but their derivatives also.

Letβs go back to our original problem and have a look at some graphs. Hereβs the graph of the function that weβve ended up with with the change of a point π₯ equals four. Marked to the left of this point the function is given by the rule π of π₯ equals ππ₯ squared plus ππ₯ plus three with π equal to zero and π equal to negative one as we found.

So here the graph has equation π¦ equals zero π₯ squared minus one π₯ plus three or just π¦ equals minus π₯ plus three. And to the right of this point of the graph is that of π¦ equals one over π₯ minus five. Notice that the two parts of the graph meet at this point. Thereβs no jump at this continuity and also thereβs no awkward corner as we go from one graph to the other.

Compare that to this graph, where the values of π and π have been chosen to be negative one and three, respectively. The function is still continuous at π₯ equals four. Thereβs no jump here. But there is a corner at the point, where the rule changes. And this tells us that the function is not differentiable at this point. You can imagine that a particle travelling along the graph of this function would suddenly change direction as it got to π₯ equals four.

Alternatively, if this were a displacement-time graph, this point π₯ equals four would represent a time at which the velocity changed suddenly. This instantaneous change in velocity would mean an infinite acceleration. And this would be bad news for you if this were a graph of your displacement over time because an infinite acceleration would kill you.

There are many applications of piecewise functions where you want it not only to be continuous at the point of which the rule changes, but also differentiable. While itβs not always a matter of life and death, being able to choose values of parameters to make a piecewise function differentiable is an important skill.