Piecewise Functions
Open the lesson
How to check whether a piecewise function is differentiable at the junction: the values must meet (continuity) and the slopes must match (equal left and right derivatives). Why |x| has a corner at 0, why values come first, the missing minus sign trap with e to the power minus x, and two JEE-style solved problems where you find a and b.
Chapters
- 0:00Introduction
- 0:37A function in two pieces
- 1:22Meeting is not enough: a corner
- 2:27The method: two checks at the junction
- 3:47Example 1: find a, b so x squared and ax + b join at x = 1
- 5:13Example 2: find a, b, exponential piece and cos x + x at 0
- 7:10Quick revision: values meet, slopes match, values first
Transcript
0:00Introduction
Hello everyone! Okay, one small puzzle before we start. Railway engineers join a curved piece of track to a straight piece. For a train to roll across that joint smoothly, what two things must be true? If the two pieces do not meet, there is a gap, and the train falls. And if they meet at a sharp angle? The train jerks, right? So the pieces must meet, and they must point in the same direction. Today, a function made of two pieces needs exactly these two checks. Questions on this come up often in JEE, so let's begin.
0:37A function in two pieces
Here is our set-up. f of x equals g of x for x less than a, and f of x equals h of x for x greater than or equal to a. This sign is less than, and this one, with a small line under it, is greater than or equal to. Okay? So f is made of two pieces: g on the left, and h on the right. They are joined at x equals a, the junction. That is our railway joint. Now, g and h are both differentiable on their own. So tell me, where can f go wrong? Only at the junction, yes! Away from x equals a, f is just g, or just h, and both are differentiable there. So all the action is at one point, the joint. Clear?
1:22Meeting is not enough: a corner
Let's see a joint in a function you already know. The picture on the left is y equals mod x. The two vertical bars mean the modulus, the absolute value of x. The right picture, the cube root of x with a vertical tangent, was from the last lesson; today we need only the left one. Now, mod x is also a function in two pieces: minus x for x less than zero, and x for x greater than or equal to zero. With me? At zero, do the pieces meet? Minus zero, and zero. Both give zero. So yes, they meet. No gap, so mod x is continuous at zero. Right? So there is no gap. Then is mod x differentiable at zero? No, no, wait! Look at the slopes. The left piece, minus x, has slope minus one. The right piece, x, has slope one. You can see both marked in the picture. They do not match. So the two pieces meet at a sharp angle, a corner, and mod x is not differentiable at zero. That is the sharp bend on our railway track! So meeting is not enough. The slopes must match too. Got it?
2:27The method: two checks at the junction
So now, the method. Check one: the values meet. g of a equals h of a. Put x equals a in both pieces, and you must get the same number. That is continuity, no gap. Okay? Check two: the slopes match. g prime of a equals h prime of a. The small dash is called prime, and g prime means the derivative of g. So, differentiate each piece as a normal function, then put x equals a. Same slope, so no corner. Clear? And both checks are needed, not just one. Only then is f differentiable at a. Now, a trap. Suppose the slopes match, but the values do not meet. Is f differentiable at a? No, never! There is a gap, so f is not even continuous at a, and a function that is not continuous at a point is never differentiable there. Look at this line. L f prime of a and R f prime of a are the left hand and right hand derivatives, and g prime of a and h prime of a give them only when f is continuous at a. So always check the values first, and then the slopes. With me? And here is a tip that toppers use. When a question has two unknowns, like a and b, the two checks give you exactly two equations. Write both, then solve. That's it!
3:47Example 1: find a, b so x squared and ax + b join at x = 1
Alright, let's use it. Example one, from the course. f of x equals x squared for x less than or equal to one, and a x plus b for x greater than one. The small raised two means squared. f is differentiable everywhere. Find a and b. Pause the video, and try it first. Done? Okay, let's check. Both pieces are polynomials, differentiable on their own sides. So where do we need to check? At the junction, x equals one, exactly! Here the equal to sign sits on the left piece, but the two checks are the same. Check one, values. The left piece gives one squared, that is one. The right piece gives a times one, plus b. So a plus b equals one. This double arrow means implies. Okay? Check two, slopes. The derivative of x squared is two x, and at x equals one, that is two. The derivative of a x plus b is just a. Right? So the slopes match when a equals two. Is that the whole answer? No, careful! Slopes alone are not enough; b is still unknown. The values must meet too. So a equals two, and b equals one minus a, that is one minus two, minus one. So a equals two, and b equals minus one. Values meet, slopes match: no gap, no corner, a smooth joint. Perfect!
5:13Example 2: find a, b, exponential piece and cos x + x at 0
Now a harder one. f of x equals a times e to the power x, plus b times e to the power minus x, for x less than zero. And f of x equals cos x plus x, for x greater than or equal to zero. f is differentiable at zero. Find a and b. Pause the video and try it. Hint: values first, then slopes. Done? Okay, let's check. Check one, the values at zero. e to the power zero is one, so the left piece gives a plus b. The right piece gives cos zero plus zero, that is one. So a plus b equals one. Clear? Now check two, the slopes. The left piece has e to the power minus x. What is the derivative of e to the power minus x? Minus e to the power minus x, yes! The chain rule gives that minus sign. So the left slope is a e to the power x, minus b e to the power minus x. At zero, that is a minus b. Careful, this is the trap: forget that minus sign, and you get a plus b again, the same equation twice. Then you cannot find a and b! Now the right piece. The derivative of cos x is minus sin x, and the derivative of x is one. At zero, sin zero is zero, so the right slope is one. Got it? So the slopes match when a minus b equals one. And the values gave a plus b equals one. Two checks, two equations, just like our tip. Now quickly, add the two equations. What do you get? Two a equals two, so a equals one, and then b equals zero. Very good! Quick check: the left piece is now e to the power x, with value one and slope one at zero, the same as the right piece. No gap, no corner. Smooth, like a good railway joint!
7:10Quick revision: values meet, slopes match, values first
So, quick revision. For a function in pieces, check only the junction. The values must meet, and the slopes must match. Both are needed. And check the values first, because a function that is not continuous at a point is never differentiable there. No gap, no corner. Now go and try the practice problems on this page. All the best!
More videos in Unit 7 · Limits, Continuity & Differentiability
- The Idea of a Limit
- Algebra of Limits and Algebraic Limits
- Limits at Infinity
- Trigonometric Limits
- Exponential and Logarithmic Limits
- The Form 1^∞
- Series Expansions
- L'Hôpital's Rule
- Greatest Integer, Fractional Part and the Sandwich Theorem
- Limits of Sequences and of Sums
- Continuity at a Point
- Continuity on an Interval, and Combinations
- Functions Built from [x], x and Absolute Values
- The Intermediate Value Theorem
- The Derivative
- Counting Points of Non-differentiability
- Functional Equations
- Standard Derivatives and the Basic Rules
- Implicit and Parametric Differentiation
- Logarithmic Differentiation
- Inverse Trigonometric Functions and Substitution
- Higher Derivatives
- Rate of Change
- Tangents and Normals
- Increasing and Decreasing Functions
- Rolle's Theorem and the Mean Value Theorem
- Local Maxima and Minima
- Absolute Extrema on a Closed Interval
- Optimisation Problems
- Extrema of Expressions, and Counting Roots
- Overview
- Mixed Problems: Set 1
- Mixed Problems: Set 2
- Mixed Problems: Set 3
- Overview
- Part A: JEE Main Level
- Part C: Concept Checks