Maths WorkshopMaths problems with full solutions
Exercise 4Calculus › Single-variable calculus › Continuity › Continuous and discontinuous functionsHigh schoolAdded 2 Nov 2026

Continuity with parameters

#continuity#piecewise functions#parameters

Statement

Find the real numbers aa and bb for which the function
f(x)={x+1if x≤1,ax+bif 1<x<3,x2−4if x≥3f(x)=\begin{cases}x+1&\text{if }x\le1,\\ ax+b&\text{if }1<x<3,\\ x^2-4&\text{if }x\ge3\end{cases}
is continuous on R\mathbb{R}.

Hint

Each piece is continuous on its own. Only the two points where the formula changes need attention: x=1x=1 and x=3x=3.

Show solutionHide solution

Solution

Idea. The function FF is continuous inside each interval, because every formula is a polynomial. The only danger is at the junctions, where the pieces must connect without a jump.

At x=1x=1. The left value is f(1)=2f(1)=2, and the right limit is a+ba+b. We need a+b=2a+b=2.

At x=3x=3. The left limit is 3a+b3a+b and f(3)=32−4=5f(3)=3^2-4=5, which equals the right limit. We need 3a+b=53a+b=5.

Solving. Subtracting the two equations gives 2a=32a=3, so a=32a=\frac32 and b=2−32=12b=2-\frac32=\frac12.

Remark. With these values the graph is made of pieces glued end to end. The function is continuous but not differentiable at 11 and 33: the slopes are 11, 32\frac32 and 66.