Step 1: Understanding the Question:
We are given a piecewise function with unknown constants $a$ and $b$. We are told the function is continuous everywhere on its domain, meaning the pieces must connect seamlessly at the boundary points $x = 1$ and $x = 3$.
Step 2: Key Formula or Approach:
For a function $f(x)$ to be continuous at a point $x = c$, the left-hand limit, the right-hand limit, and the function value at that point must all be equal:
$$\lim_{x \to c^-} f(x) = \lim_{x \to c^+} f(x) = f(c)$$
We will apply this condition at $x = 1$ and $x = 3$ to set up a system of two linear equations in terms of $a$ and $b$.
Step 3: Detailed Explanation:
Continuity at $x = 1$:
Left-hand limit (using $x \le 1$ piece):
$$\lim_{x \to 1^-} f(x) = 1 + \sin\left(\frac{\pi}{2}\right) = 1 + 1 = 2$$
Right-hand limit (using $1 < x < 3$ piece):
$$\lim_{x \to 1^+} f(x) = a(1) + b = a + b$$
Equating the limits gives our first equation:
$$a + b = 2 \quad \dots \text{(Equation 1)}$$
Continuity at $x = 3$:
Left-hand limit (using $1 < x < 3$ piece):
$$\lim_{x \to 3^-} f(x) = a(3) + b = 3a + b$$
Right-hand limit (using $3 \le x < 6$ piece):
$$\lim_{x \to 3^+} f(x) = 6\tan\left(\frac{3\pi}{12}\right) = 6\tan\left(\frac{\pi}{4}\right)$$
Since $\tan(\frac{\pi}{4}) = 1$, the limit is $6 \times 1 = 6$.
Equating the limits gives our second equation:
$$3a + b = 6 \quad \dots \text{(Equation 2)}$$
Solving the system:
Subtract Equation 1 from Equation 2:
$$(3a + b) - (a + b) = 6 - 2$$
$$2a = 4 \implies a = 2$$
Substitute $a = 2$ back into Equation 1:
$$2 + b = 2 \implies b = 0$$
Step 4: Final Answer:
The values of $a$ and $b$ are 2 and 0 respectively, matching option (D).