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.