Step 1: Find the range of the inner function.
Let \(g(x) = \sin x + \cos x\). We need to find the range of g(x) for \(x \in [0, \pi/2]\).
We can rewrite g(x) in the form \(R \sin(x+\alpha)\) or \(R \cos(x-\alpha)\).
\[ g(x) = \sqrt{2} \left(\frac{1}{\sqrt{2}}\sin x + \frac{1}{\sqrt{2}}\cos x\right) = \sqrt{2} \sin(x + \pi/4) \]
The interval for x is \([0, \pi/2]\).
So, the interval for \(x + \pi/4\) is \([\pi/4, 3\pi/4]\).
In this interval, \(\sin(x + \pi/4)\) takes its values.
- At \(x+\pi/4 = \pi/4\), \(\sin(\pi/4) = 1/\sqrt{2}\).
- At \(x+\pi/4 = \pi/2\), \(\sin(\pi/2) = 1\).
- At \(x+\pi/4 = 3\pi/4\), \(\sin(3\pi/4) = 1/\sqrt{2}\).
The minimum value of \(\sin(x + \pi/4)\) is \(1/\sqrt{2}\) and the maximum is 1.
So, the range of \(g(x) = \sqrt{2} \sin(x + \pi/4)\) is \([\sqrt{2} \cdot \frac{1}{\sqrt{2}}, \sqrt{2} \cdot 1] = [1, \sqrt{2}]\).
Step 2: Find the maximum (M) and minimum (m) values of f(x).
The function \(f(x) = \tan^{-1}(g(x))\). Since \(\tan^{-1}\) is an increasing function, its maximum and minimum values will occur when its argument g(x) is maximum and minimum, respectively.
- Minimum value \(m = \tan^{-1}(\min(g(x))) = \tan^{-1}(1) = \pi/4\).
- Maximum value \(M = \tan^{-1}(\max(g(x))) = \tan^{-1}(\sqrt{2})\).
Step 3: Calculate \(\tan(M-m)\).
We use the formula \(\tan(A-B) = \frac{\tan A - \tan B}{1 + \tan A \tan B}\).
Here, A = M and B = m.
\[ \tan(M-m) = \frac{\tan M - \tan m}{1 + \tan M \tan m} \]
We have:
- \(\tan M = \tan(\tan^{-1}(\sqrt{2})) = \sqrt{2}\)
- \(\tan m = \tan(\tan^{-1}(1)) = 1\)
Substitute these values:
\[ \tan(M-m) = \frac{\sqrt{2} - 1}{1 + \sqrt{2} \cdot 1} = \frac{\sqrt{2} - 1}{\sqrt{2} + 1} \]
To simplify, rationalize the denominator:
\[ \tan(M-m) = \frac{\sqrt{2} - 1}{\sqrt{2} + 1} \times \frac{\sqrt{2} - 1}{\sqrt{2} - 1} = \frac{(\sqrt{2} - 1)^2}{(\sqrt{2})^2 - 1^2} = \frac{2 - 2\sqrt{2} + 1}{2 - 1} = 3 - 2\sqrt{2} \]
The official answer is \(3 - 2\sqrt{2}\).
which is correct.