Tutorials › Calculus I › Oscillation in a Difference Quotient

The Derivative from First Principles · Tutorial 363 of 1495

Oscillation in a Difference Quotient

Use the difference quotient and carefully chosen inputs to test whether oscillation prevents differentiability at the origin.

Intermediate 9 min read

What You'll Learn

  • Write the derivative at zero as a difference quotient.
  • Show that \(x\sin(1/x)\), extended by zero at the origin, is continuous there.
  • Use two explicit sequences of inputs to prove the quotient has no limit.
  • Distinguish a function’s oscillation from the behavior of its difference quotient.
  • Compare the example with functions whose difference quotients do converge or oscillate differently.
  • Avoid inferring a derivative from continuity or boundedness alone.

When a Small Function Value Does Not Give a Derivative

A function can approach zero as its input approaches zero and still fail to have a derivative there. The key is that a derivative depends not just on the size of the function value, but on how that value compares with the input change.

The function \(x\sin(1/x)\) is a useful example. Its sine factor oscillates increasingly rapidly near zero, while the factor \(x\) keeps the function values small. To decide whether the function is differentiable at zero, we must examine the difference quotient itself.

Definition and the Difference Quotient

Definition: If \(f\) is defined on an interval around \(a\), its derivative at \(a\) exists if the finite limit $$ f'(a)=\lim_{h\to 0}\frac{f(a+h)-f(a)}{h} $$ exists. The quotient is considered for \(h\ne 0\).

Define \(f:\mathbb{R}\to\mathbb{R}\) by

$$ f(x)= \begin{cases} x\sin(1/x), & x\ne 0,\\ 0, & x=0. \end{cases} $$

At the origin, \(a=0\) and \(f(0)=0\). Therefore, for \(h\ne 0\), the difference quotient is

$$ \frac{f(0+h)-f(0)}{h} = \frac{h\sin(1/h)-0}{h} = \sin(1/h). $$

The cancellation of \(h\) is valid because the quotient is defined only for \(h\ne 0\). The derivative exists precisely if \(\sin(1/h)\) approaches one finite value as \(h\to 0\).

The Function Is Continuous at the Origin

Before testing differentiability, it is helpful to check what happens to the function values. For every \(x\ne 0\), the bound \(|\sin(1/x)|\le 1\) gives

$$ |f(x)-f(0)| = |x\sin(1/x)| \le |x|. $$

As \(x\to 0\), the right-hand side tends to zero. Hence \(f(x)\to f(0)=0\), so \(f\) is continuous at zero. This fact does not settle differentiability: the difference quotient divides the function change by \(h\), and its value is \(\sin(1/h)\), not \(h\sin(1/h)\).

Why the Difference Quotient Has No Limit

The input \(1/h\) becomes arbitrarily large in magnitude as \(h\to 0\). More importantly, we can choose inputs approaching zero for which \(1/h\) lands at angles where the sine has different exact values.

Worked Example: The Function \(x\sin(1/x)\) at Zero

For each positive integer \(n\), choose

$$ h_n=\frac{1}{\pi/2+2\pi n}, \qquad k_n=\frac{1}{3\pi/2+2\pi n}. $$

Both denominators grow without bound as \(n\to\infty\), so \(h_n\to 0\) and \(k_n\to 0\). They are nonzero inputs, as required for the difference quotient. Along the first sequence,

$$ \frac{f(h_n)-f(0)}{h_n} = \sin(1/h_n) = \sin(\pi/2+2\pi n) = 1. $$

Along the second sequence,

$$ \frac{f(k_n)-f(0)}{k_n} = \sin(1/k_n) = \sin(3\pi/2+2\pi n) = -1. $$

These quotient values cannot both approach the same limit. To make the contradiction precise, suppose the difference quotient had a limit \(L\). By the definition of a limit, for every sufficiently small nonzero \(h\), its quotient would be within \(1/2\) of \(L\). Since both sequences approach zero, this would require

$$ |1-L|<\frac12 \qquad\text{and}\qquad |-1-L|<\frac12. $$

But the triangle inequality would then imply

$$ 2 = |1-(-1)| \le |1-L|+|L-(-1)| <1, $$

which is impossible. Therefore the difference quotient has no limit, and \(f'(0)\) does not exist. The function is continuous at zero but not differentiable there.

Theorem: If a limit exists as \(h\to 0\), then the values along every sequence of nonzero inputs tending to zero must approach that same limit. Thus, finding two such sequences with different limiting quotient values proves that the limit does not exist.

The reason is direct: if a limit \(L\) exists, then for each positive tolerance \(\varepsilon\), there is a distance \(\delta>0\) such that \(0<|h|<\delta\) makes the quotient differ from \(L\) by less than \(\varepsilon\). Any sequence tending to zero eventually satisfies \(0<|h|<\delta\). Its quotient values must therefore approach \(L\) as well. In the example, the two sequences instead give the constant values \(1\) and \(-1\).

Oscillation in the Function Versus Oscillation in the Quotient

The function \(x\sin(1/x)\) oscillates near zero, but its values shrink to zero. Differentiability asks a sharper question: do the function changes shrink in a way that makes their ratio to the input change settle to one number? A nearby example shows that an oscillating formula can still have a derivative if the quotient is controlled.

Worked Example: An Oscillating Function That Is Differentiable at Zero

Define \(g(0)=0\) and \(g(x)=x^2\sin(1/x)\) for \(x\ne 0\). The difference quotient at zero is

$$ \frac{g(h)-g(0)}{h} = \frac{h^2\sin(1/h)}{h} = h\sin(1/h), \qquad h\ne 0. $$

Since \(|\sin(1/h)|\le 1\),

$$ \left|\frac{g(h)-g(0)}{h}\right| = |h\sin(1/h)| \le |h|. $$

Given any \(\varepsilon>0\), choose \(\delta=\varepsilon\). If \(0<|h|<\delta\), the quotient has absolute value at most \(|h|<\varepsilon\). Thus the quotient tends to zero, and

$$ g'(0)=0. $$

As a check, the derivative value is the limit of the original quotient: the bound forces every quotient value sufficiently near zero to be close to zero, regardless of the oscillation in the sine factor.

The contrast is the extra factor of \(h\) in the quotient for \(g\). In the first example, cancellation leaves a sine that continues to take separated values. In this example, the remaining factor \(h\) forces the quotient to zero.

A Second Oscillating Quotient

The same test works when the oscillating expression is shifted or rescaled. The details of the sequences change, but the essential issue remains: two approaches to zero produce incompatible quotient values.

Worked Example: Adding a Constant to the Oscillation

Define \(q(0)=0\) and \(q(x)=x(1+\sin(1/x))\) for \(x\ne 0\). First, the function is continuous at zero because \(-1\le \sin(1/x)\le 1\), so \(0\le 1+\sin(1/x)\le 2\), and therefore

$$ |q(x)-q(0)| = |x|\,|1+\sin(1/x)| \le 2|x| \longrightarrow 0. $$

Its difference quotient at zero is

$$ \frac{q(h)-q(0)}{h} = 1+\sin(1/h), \qquad h\ne 0. $$

Use \(h_n=1/(\pi/2+2\pi n)\) and \(k_n=1/(3\pi/2+2\pi n)\), which both tend to zero. The corresponding quotients are

$$ 1+\sin(1/h_n)=1+1=2, \qquad 1+\sin(1/k_n)=1+(-1)=0. $$

If the quotient had a limit \(L\), these two sequences would require \(L=2\) and \(L=0\), which is impossible. Hence \(q'(0)\) does not exist. Substitution into the difference quotient verifies the values \(2\) and \(0\), so the conclusion follows from the derivative definition.

Common Mistake: Bounded Does Not Mean Convergent

A tempting but incorrect argument is: “The quotient is \(\sin(1/h)\), and sine is bounded, so the quotient has a finite limit.” The calculation correctly identifies a bound, but boundedness alone does not imply that values approach a single number. In this case, the quotient is always between \(-1\) and \(1\), yet the explicit inputs above produce \(1\) and \(-1\) arbitrarily close to zero.

Another error is to infer the derivative from \(f(h)\to 0\). The derivative quotient is not simply \(f(h)\); it is \(f(h)/h\). For this function,

$$ f(h)\longrightarrow 0, \qquad \frac{f(h)-f(0)}{h}=\sin(1/h). $$

The first limit establishes continuity at zero. The second is the one that determines differentiability, and it fails to exist.

A Practical Test for This Kind of Example

1
Write the quotient from the definition.
At the point in question, substitute the function values and simplify only for nonzero input changes.
2
Look for inputs that fix the oscillating phase.
Choose nonzero inputs tending to zero that make the inner expression equal to angles with distinct sine or cosine values.
3
Compare the quotient values.
If two approaches to the point force different limiting values, the derivative limit cannot exist.

This approach is especially useful when an expression contains a rapidly changing term such as \(\sin(1/h)\). It replaces a vague claim that the quotient “keeps oscillating” with exact inputs and exact values.

Why This Example Matters

The example separates three ideas that are easy to confuse. First, \(f(x)\to 0\) means the function is continuous at zero. Second, a bounded difference quotient need not converge. Third, differentiability requires the quotient to approach one finite value, not merely to remain within some range.

The decisive calculation is

$$ \frac{f(h)-f(0)}{h}=\sin(1/h). $$

The sine values do not settle as \(h\) approaches zero: carefully chosen positive inputs make the quotient equal \(1\) or \(-1\) arbitrarily near zero. That is enough to rule out a derivative, even though the function itself approaches its value at the origin.

Check Your Understanding

Answer each question by referring to the difference quotient, rather than only to the function values.

  1. What is the difference quotient at zero for \(f(x)=x\sin(1/x)\), with \(f(0)=0\)?
  2. Why does \(|f(x)|\le |x|\) prove continuity at zero but not differentiability there?
  3. What quotient values result from \(h_n=1/(\pi/2+2\pi n)\) and \(k_n=1/(3\pi/2+2\pi n)\)?
  4. Why do two sequences approaching zero that produce different limiting quotient values rule out a derivative?
  5. For \(g(x)=x^2\sin(1/x)\), with \(g(0)=0\), what bound proves that \(g'(0)=0\)?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon