Why a Piecewise Join Needs Its Own Test
A piecewise formula may describe a function smoothly on either side of a point, yet behave differently where the formulas meet. At that join, the derivative might fail to exist, so a test based only on the second derivative cannot decide whether concavity continues across it.
The useful question is not whether the derivative exists at the join. Instead, ask how the slopes approach the join from each side. For concavity to hold across a continuous join, the slope on the left must be at least as large as the slope on the right. A sharp downward corner can therefore preserve concavity; a sharp upward corner cannot.
Concavity and Secant Slopes
A function \(f\) is concave on an interval \(I\) if, for any \(x,y\in I\) and any \(t\in[0,1]\),
Geometrically, the graph between two points lies on or above the chord joining them. A useful equivalent test is that secant slopes decrease as we move from left to right. For \(x<y<z\), define the secant slope between \(a\) and \(b\) by
Concavity implies \(S(x,y)\geq S(y,z)\). Conversely, if that inequality holds for every \(x<y<z\) in an interval, then \(f\) is concave there. The criterion expresses the same idea as the chord definition: later secants cannot be steeper than earlier ones.
The One-Sided Slope Test
Suppose \(f\) is continuous at an interior join \(c\), and its restrictions to the intervals on either side are concave. Assume also that the finite one-sided derivatives exist:
These are the slopes approached from the left and right, respectively. The derivative at \(c\) exists precisely when these two limits are equal. Concavity across the join, however, allows them to differ.
Why the Slope Test Works
Here is a proof using secant slopes. If \(f\) is concave on the left interval, its secant slopes decrease as their endpoints move towards \(c\). In particular, for \(x<c\), the slope from \(x\) to \(c\) is at least the limiting left-hand slope. If \(f\) is concave on the right interval, the slope from \(c\) to \(y\) is at most the limiting right-hand slope for \(y>c\). Therefore, when \(f'_-(c)\geq f'_+(c)\),
These inequalities also order secants whose endpoints do not include \(c\). For example, if \(x<y<c<z\), left-side concavity gives \(S(x,y)\geq S(y,c)\). The slope \(S(y,z)\) is a weighted average of \(S(y,c)\) and \(S(c,z)\); since \(S(y,c)\geq S(c,z)\), it follows that \(S(y,z)\leq S(y,c)\). Thus \(S(x,y)\geq S(y,z)\). The case \(x<c<y<z\) follows in the same way: \(S(x,y)\) is a weighted average of \(S(x,c)\) and \(S(c,y)\), both at least \(S(y,z)\). Triples that lie on just one side are covered by the assumed concavity of that piece. Hence the secant-slope criterion holds across the join, proving concavity.
For the reverse implication, suppose \(f\) is concave across \(c\). For any \(h,k>0\) small enough that \(c-h\) and \(c+k\) are in the interval, the secant-slope criterion gives
Letting \(h\) and \(k\) tend to zero gives \(f'_-(c)\geq f'_+(c)\). This proves necessity as well as sufficiency.
Worked Example: A Downward Corner That Preserves Concavity
Worked Example: A Downward Corner That Preserves Concavity
Consider
Each piece is linear, so it is concave on its own interval. At the join, \(f(0)=0\); the right-hand formula also tends to \(0\), so \(f\) is continuous there. The one-sided derivatives are
Since \(1\geq -1\), the slope test shows that \(f\) is concave across the join, although its derivative at \(0\) does not exist. For a direct check, take \(x=-1\), \(y=1\), and \(t=\frac12\). Then \(f(0)=0\), while
Thus \(f(0)\geq \frac12f(-1)+\frac12f(1)\), as required by the chord inequality for these points. The slope test establishes the inequality for all relevant points, not just this check.
Worked Example: An Upward Corner That Breaks Concavity
Worked Example: An Upward Corner That Breaks Concavity
Now consider
Both pieces are linear and therefore concave individually. The formulas meet continuously at \(g(0)=0\). But the one-sided slopes are
Because \(1<2\), the slope jumps upward, so \(g\) is not concave across \(0\). A concrete chord check confirms the failure. Using \(x=-1\), \(y=1\), and \(t=\frac12\), we have
Concavity would require \(g(0)\geq \frac12\), but \(0<\frac12\). The inequality fails, so the function is not concave across the join.
Worked Example: Concave Pieces with Different Curvatures
Worked Example: Concave Pieces with Different Curvatures
Consider
The function is continuous at \(0\): both pieces give \(0\) there. On the left, \(h''(x)=-2<0\); on the right, \(h''(x)=-2<0\). Thus each piece is concave. The one-sided derivatives are
Since \(0\geq -3\), the slope test establishes concavity across the join. As a numerical chord check, \(h(-1)=-1\), \(h(1)=-4\), and \(h(0)=0\). Their midpoint values satisfy
The derivative is not defined at \(0\), but the downward slope jump is exactly what allows the two concave pieces to remain concave together.
A Concavity Change Is a Different Question
The slope test above addresses whether two pieces that are already concave remain concave as one function. A separate question is whether concavity changes at the join. To investigate that, first determine the concavity on each side; when the second derivative exists, its sign provides the usual test. Opposite concavity on the two sides indicates a change in concavity, provided the join is part of the graph and the change occurs there.
Worked Example: Opposite Concavity on the Two Sides
Let
The formulas meet continuously at \(q(0)=0\). For \(x<0\), \(q''(x)=2>0\), so the left piece is convex. For \(x>0\), \(q''(x)=-2<0\), so the right piece is concave. Thus the concavity changes across \(0\). The one-sided first derivatives are both \(0\), but this does not prevent the change: it is the curvature on the two open sides that distinguishes them. The second derivative at the join does not exist, since the one-sided second derivatives are \(2\) and \(-2\).
The function is not concave across the whole interval. For instance, with \(x=-2\), \(y=-1\), and \(z=1\),
The required inequality \(-3\geq -1\) is false. This agrees with the change in concavity: the function cannot be concave on an interval containing both sides.
A Common Mistake: Treating a Missing Derivative as a Concavity Change
A missing derivative at the join is not enough to conclude that concavity changes. In the first example, the derivative does not exist at \(0\), but the function is concave on both sides and the left-hand slope exceeds the right-hand slope. It remains concave across the join.
The reverse shortcut is also unreliable: knowing that both pieces are individually concave does not guarantee that the joined function is concave. In the upward-corner example, each linear piece is concave, but the slope jump from \(1\) to \(2\) violates the necessary ordering.
How to Analyze a Piecewise Join
Confirm that the function is defined at the join and is continuous there before using the slope test.
Determine whether each piece is concave or convex on its interval, using the applicable concavity criterion.
If both pieces are concave, test whether \(f'_-(c)\geq f'_+(c)\). The derivative at the join itself need not exist.
Report the concavity on each side and whether concavity holds across the join. These are related but distinct claims.
The distinction matters when interpreting a graph or classifying an inflection point: the behavior on either side and the behavior of the whole function across the join should not be conflated. Second-derivative tests describe curvature where the second derivative exists; the one-sided slope comparison handles a continuous join where it does not.
Check Your Understanding
For each question, use the concavity of the pieces and the behavior at the join to justify your answer.
- For a continuous join of two concave pieces, which inequality between the one-sided derivatives ensures concavity across the join?
- Can a function be concave across a join where its derivative does not exist? Explain using the slope test.
- For \(f(x)=x\) when \(x\leq 0\) and \(f(x)=3x\) when \(x>0\), does concavity hold across \(0\)? Show the one-sided slopes.
- Why does knowing that both pieces are concave not by itself guarantee that their joined function is concave?
- If the second derivative has opposite signs on the two open sides of a continuous join, what does that say about concavity on either side, and what does it not establish by itself?