The Dance of the Piecewise Function
Welcome, fellow explorers of calculus. Today, we are diving into a problem that perfectly illustrates the difference between "smooth" behavior and the subtle, hidden truths of limits.
We are examining the function f(x)=x2cos(xπ) for $x
eq 0$, with f(0)=0. Our goal is to determine if this function is differentiable at two very different points: the origin (x=0) and a point in the wild (x=2).
Phase 1
The Origin and the First Principle
When we stand at x=0, we are at a boundary. The function is defined by a specific rule at this point, but by a completely different algebraic expression everywhere else.
Because of this, we cannot simply take the derivative of the expression x2cos(xπ) and plug in 0. Instead, we must return to the bedrock of calculus: the First Principle of Derivatives.
The definition of the derivative at
x=0 is given by the limit:
f′(0)=h→0limhf(0+h)−f(0)
Substituting our function, we get:
f′(0)=h→0limhh2cos(hπ)−0
Simplifying this, we find ourselves staring at the limit:
f′(0)=h→0limhcos(hπ)
Phase 2
The Squeeze Theorem to the Rescue
This is where the problem gets thrilling. As h approaches 0, the term hπ explodes toward infinity. The cosine of an infinite angle oscillates wildly between −1 and 1.
If you were to graph this, you would see the function frantically bouncing between the parabolic envelopes y=x2 and y=−x2. Does this mean the derivative doesn't exist? Not necessarily!
We know that for any value of
h:
−1≤cos(hπ)≤1
If we multiply this entire inequality by
∣h∣, we get:
−∣h∣≤hcos(hπ)≤∣h∣
As h approaches 0, both −∣h∣ and ∣h∣ shrink to 0. By the Squeeze Theorem, the expression trapped in the middle is forced to 0.
Thus, f′(0)=0. The function is differentiable at the origin, and its tangent is a flat, horizontal line!
Phase 3
The Victory Lap at x=2
Now that we have conquered the origin, x=2 feels like a walk in the park. We are far from the piecewise boundary, so we can use our standard toolkit.
Our function is a product of two functions: u=x2 and v=cos(xπ). We use the Product Rule: f′(x)=u′v+uv′.
The derivative of
x2 is
2x. For the derivative of
cos(xπ), we use the Chain Rule:
−sin(xπ)⋅(−x2π)
Putting it all together, we get:
f′(x)=2xcos(xπ)+x2[x2πsin(xπ)]
The
x2 terms cancel out, leaving:
f′(x)=2xcos(xπ)+πsin(xπ)
Evaluating this at
x=2:
f′(2)=2(2)cos(2π)+πsin(2π)
Since cos(2π)=0 and sin(2π)=1, the first term vanishes, and we are left with f′(2)=π. The function is perfectly differentiable here as well.
Conclusion
We have successfully navigated the treacherous waters of the origin and the smooth terrain of x=2. We found that the function is differentiable at both points.
This problem is a beautiful reminder that in calculus, even when things look chaotic, there is often a rigorous, elegant structure waiting to be revealed if you just apply the right tools.