For the function f:(0,∞)→R given by f(x)=x2sinx1,0<x<∞, show that there is a differentiable function g:R→R that extends f.
Technique
Extend by the same formula and set g(0)=0; differentiate by rules off 0, and use the first-principles difference quotient with the squeeze theorem at 0.
Solution
We must produce a single g defined on all of R, differentiable everywhere, agreeing with f on (0,∞). The natural candidate extends the formula across 0 and sets g(0)=0; the only delicate point is differentiability at 0, where we use the x2 damping.
Step 1 — Define the extension
Set
g(x)=⎩⎨⎧x2sinx1,0,x=0,x=0.
On (0,∞), g(x)=x2sin(1/x)=f(x), so g extends f. (We have extended the same formula to x<0 as well and patched the value at 0; any choice agreeing with f on (0,∞) and differentiable on R works, and this one does.)
Step 2 — Differentiability at every x=0
For x=0, g is a composition/product of differentiable functions (x↦x2, x↦1/x, sin), all differentiable on R∖{0}. By the product and chain rules,