Problem 164
Medium Differentiation Techniques

Given f(x) = cases (x-2) arctan 1/(x-2), x ≠ 2,, [6pt] 0

Given $f(x) = \begin{cases} (x-2)\arctan\dfrac{1}{x-2}, & x \neq 2, \\[6pt] 0, & x = 2, \end{cases}$ is $f$ differentiable for every $x$? Find $f'(2)$.

Explanation of Method

Continuous everywhere, differentiable everywhere but one point.

Step 1: Differentiability away from $x = 2$

For $x \neq 2$ the function is a product of differentiable functions. Writing $t = x-2$ (so $\dfrac{dt}{dx} = 1$) and using the chain rule on $\arctan\dfrac1t$: \[\frac{d}{dt}\arctan\frac1t = \frac{1}{1+\dfrac{1}{t^{2}}}\cdot\left(-\frac{1}{t^{2}}\right) = -\frac{1}{t^{2}+1}.\]

The product rule then gives

\[ f'(x) = \arctan\frac{1}{x-2} - \frac{x-2}{(x-2)^{2}+1}, \qquad x \neq 2. \]

Step 2: The difference quotient at $x = 2$

Since $f(2) = 0$, the factor $h$ cancels completely: $\frac{f(2+h)-f(2)}{h} = \frac{h\arctan\dfrac1h}{h} = \arctan\frac{1}{h}$.

Step 3: The one-sided limits

\[ \lim_{h\to 0^{+}}\arctan\frac1h = \arctan(+\infty) = \frac{\pi}{2}, \qquad \lim_{h\to 0^{-}}\arctan\frac1h = \arctan(-\infty) = -\frac{\pi}{2}. \]

They are finite but unequal, so the two-sided limit does not exist and neither does $f'(2)$.

Step 4: Continuity at $x = 2$

The failure is not a failure of continuity. Since $\left|\arctan\dfrac{1}{x-2}\right| \leq \dfrac{\pi}{2}$: \[\bigl|f(x)-f(2)\bigr| = \left|(x-2)\arctan\frac{1}{x-2}\right| \leq \frac{\pi}{2}\,|x-2| \;\xrightarrow[x\to 2]{}\; 0 \;\;\checkmark\]

\[\text{One-sided slopes: } f'_{+}(2) = \frac{\pi}{2} \approx 1.5708, \qquad f'_{-}(2) = -\frac{\pi}{2} \approx -1.5708\]

So $f$ is continuous at $x = 2$ with a corner there, the two tangent half-lines having slopes $\pm\tfrac{\pi}{2}$.


Result

Final answer:

\[\boxed{\,f\ \text{is differentiable for every } x \neq 2, \qquad f'(2)\ \text{does not exist}\,}\]

Remark

Remark. Compare Problem 21, where $x\sin\tfrac1x$ is continuous at the origin but has no one-sided derivatives at all, the quotient oscillating forever. Here the quotient $\arctan\tfrac1h$ settles down on each side; it simply settles on two different values. Replacing the factor $x-2$ by $(x-2)^{2}$ would restore differentiability, exactly as in Problem 22.