Step 1: Differentiability Condition.
For \( f(x) \) to be differentiable everywhere, it must be differentiable at all points, including \( x = 1 \). This implies:
The function \( f(x) \) is continuous at \( x = 1 \).
The derivative \( f'(x) \) exists at \( x = 1 \), which means the left-hand derivative equals the right-hand derivative at \( x = 1 \).
Step 2: Check Continuity at \( x = 1 \).
Calculate the left-hand and right-hand limits at \( x = 1 \):
Left-hand limit (\( x \leq 1 \)): \( f(1) = 1^2 + 3 \cdot 1 + a = 1 + 3 + a = 4 + a \),
Right-hand limit (\( x>1 \)): \( f(1) = b \cdot 1 + 2 = b + 2 \).
For continuity:
\[
4 + a = b + 2 \implies b = a + 2. \quad (1)
\]
Step 3: Check Differentiability at \( x = 1 \).
Compute the derivatives on both sides:
Left-hand derivative (\( x \leq 1 \)): \( f'(x) = \frac{d}{dx} (x^2 + 3x + a) = 2x + 3 \),
At \( x = 1^- \): \( f'(1) = 2 \cdot 1 + 3 = 5 \),
Right-hand derivative (\( x>1 \)): \( f'(x) = \frac{d}{dx} (bx + 2) = b \),
At \( x = 1^+ \): \( f'(1) = b \).
For differentiability, the derivatives must be equal at \( x = 1 \):
\[
5 = b. \quad (2)
\]
Step 4: Solve the System.
From equation (2), \( b = 5 \). Substitute into equation (1):
\[
5 = a + 2 \implies a = 5 - 2 = 3.
\]
So, \( a = 3 \), \( b = 5 \).
Step 5: Verification.
Continuity: \( 4 + a = 4 + 3 = 7 \), \( b + 2 = 5 + 2 = 7 \), satisfied.
Differentiability: Left derivative = 5, right derivative = \( b = 5 \), satisfied.
The values \( a = 3 \), \( b = 5 \) match option (A).