Does the function f(x) = cases x sin frac1x, x ≠0, 0, x=0
Does the function $f(x) = \begin{cases} x\sin\frac1x, & x\ne0 \\ 0, & x=0\end{cases}$ satisfy Dirichlet's conditions on $(-l,l)$?
Explanation of Method
Boundedness and continuity are routine (a squeeze-theorem argument at $x=0$). The interesting condition is the count of extrema: critical points of $x\sin(1/x)$ satisfy the transcendental equation $\tan(1/x)=1/x$, which has infinitely many solutions accumulating at $x=0$. That single fact is enough to violate Dirichlet's finite-extrema requirement, regardless of how well-behaved the function looks otherwise.
- Bound $f$ using $|\sin(1/x)|\le1$.
- Confirm continuity at $x=0$ via the squeeze theorem.
- Find critical points by solving $f'(x)=0$, and show there are infinitely many near $x=0$.
Step 1 · Boundedness
For $x\ne0$: $$ |f(x)| = \left|x\sin\frac1x\right| \le |x|. $$ On $(-l,l)$, $|f(x)|\le l$; also $f(0)=0$. So $f$ is bounded.
Step 2 · Continuity
For $x\ne0$, $f$ is a product of continuous functions, hence continuous. At $x=0$: since $|x\sin(1/x)|\le|x|\to0$, the squeeze theorem gives $\lim_{x\to0}f(x)=0=f(0)$. So $f$ is continuous everywhere on $(-l,l)$ — conditions 2 and 4 (discontinuities and their limits) are trivially satisfied.
Step 3 · Extrema
For $x\ne0$: $$ f'(x) = \sin\frac1x - \frac1x\cos\frac1x. $$ Setting $f'(x)=0$ and writing $u=1/x$: $$ \sin u = u\cos u \iff \tan u = u. $$ This transcendental equation has one solution in each interval $\left((n-\frac12)\pi,(n+\frac12)\pi\right)$ for every nonzero integer $n$ — infinitely many solutions, with $u\to\infty$ possible on either side, meaning $x=1/u\to0$. So there are infinitely many critical points of $f$ accumulating at $x=0$, hence infinitely many local extrema in any neighborhood of $0$ (for instance, near each $x=\frac2{(4k+1)\pi}\to0$ where $\sin(1/x)=1$).
Summary Table
| Dirichlet condition | Status |
|---|---|
| Bounded | ✓ $|f(x)|\le l$ |
| Finitely many discontinuities | ✓ continuous everywhere |
| Finitely many extrema | ✗ infinitely many, accumulating at $x=0$ |
| One-sided limits finite | ✓ (vacuous — no discontinuities) |
Additional Notes
- This is the classic counterexample showing that continuity and boundedness alone do not guarantee Dirichlet's conditions — the finite-extrema requirement is a genuinely independent condition that this function fails.
- Contrast with $\sin(1/x)$ itself (without the $x$ factor): that function isn't even continuous at $0$ (no limit exists), so it fails condition 2 as well as condition 3 — the extra factor of $x$ here "fixes" continuity but not the oscillation count.
- The accumulation of critical points near $x=0$ is the same phenomenon that makes $\sin(1/x)$-type functions standard examples in real analysis for testing definitions of bounded variation and Riemann integrability.