Both x² and mx + b are differentiable functions of x (they are both polynomials), so if f(x) is also differentiable, we need to pay special attention at x = 2 where the two pieces of f meet.
Continuity means that the limit
![\displaystyle \lim_(x\to2) f(x)](https://img.qammunity.org/2020/formulas/mathematics/high-school/br963wy5a35fntmj7oemz2caghe0306csc.png)
must exist.
From the left side, we have x < 2 and f(x) = x², so
![\displaystyle \lim_(x\to2^-) f(x) = \lim_(x\to2) x^2 = 4](https://img.qammunity.org/2020/formulas/mathematics/high-school/n2lj548t5zagih3sk1jvpg15vrwjft6rgs.png)
From the right, we have x > 2 and f(x) = mx + b, so
![\displaystyle \lim_(x\to2^+) f(x) = \lim_(x\to2) (mx+b) = 4m+b](https://img.qammunity.org/2020/formulas/mathematics/high-school/sj299xv67koosy0201o2k531euz0p6mez8.png)
It follows that 4m + b = 4.
Differentiability means that the limit
![\displaystyle \lim_(x\to2) (f(x) - f(2))/(x - 2)](https://img.qammunity.org/2020/formulas/mathematics/high-school/kpegy2b21l4hmbrd48bikjneey3kymjj27.png)
must exist.
From the left side, we again have x < 2 and f(x) = x². Then
![\displaystyle \lim_(x\to2^-)(f(x)-f(2))/(x-2) = \lim_(x\to2) (x^2-4)/(x-2) = \lim_(x\to2) (x+2) = 4](https://img.qammunity.org/2020/formulas/mathematics/high-school/kyb4dzhs2olctiepfq59dpf902z739dync.png)
From the right side side, we have x > 2 so f(x) = mx + b. Then
![\displaystyle \lim_(x\to2^+)(f(x)-f(2))/(x-2) = \lim_(x\to2) ((mx+b)-(2m+b))/(x-2) = \lim_(x\to2) (mx-2m)/(x-2) = \lim_(x\to2)m = m](https://img.qammunity.org/2020/formulas/mathematics/high-school/55mq2v5uue0rewwsuawfrhpl3g9pyx02w9.png)
The one-sided limits must be equal, so m = 4, and from the other constraint it follows that 16 + b = 4, or b = -12.