Find a constant such that the function is differentiable everywhere.

106 Views Asked by At

I am doing some practice problems and I need to find a constant $a$ such that

$$ f(x) = \begin{cases} \hfill x\left(1+2x\sin\left(\frac{1}{x}\right)\right) \hfill & \text{ $x \neq 0$} \\ \hfill a \hfill & \text{ $x = 0$} \\ \end{cases} $$

is differentiable everywhere.

To approach this problem, I believe I would need to differentiate $f$ and then take the limit of the derivative at zero. However I'm not sure how that would work since the sine function doesn't have a limit at infinity.

2

There are 2 best solutions below

0
On

For a function to be differentiable at a point, it is necessary (but not sufficient) that the function be continuous at that point. To answer your question, we must first find a constant $a$ such that your function becomes continuous. Next, we check to see if the function is differentiable at that point.

One possible way to approach the first part (continuity) is to upper bound and lower bound the function and show that the limit of both bounds approach the same constant $a$.

For example, note that $$-1\leq\sin(\frac{1}{x})\leq1$$ From this, we can claim $$x(1-2x)\leq x(1+2x\sin(\frac{1}{x}))\leq x(1+2x)$$

Next we can take the limit as $x$ approaches $0$. For the left hand side, $\lim_{x\to0} x(1-2x)=0$, and for the right hand side, $\lim_{x\to0} x(1+2x)=0$. It follows that $$0\leq \lim_{x\to0}x(1+2x\sin(\frac{1}{x}))\leq 0$$ So your constant $a$ must be equal to $0$.

We can check our results with the following graph. In the figure, the blue plot is $x(1+2x)$. The green plot is x(1-2x). The red plot is $x(1+2x\sin(\frac{1}{x}))$.

To show differentiability, we use the definition of the derivative $$f'(b)=\lim_{h\to0}\frac{f(b+h)-f(b)}{h}$$ plugging in $b=0$ (with $f(0)=0$), we find, $$f'(0)=\lim_{h\to0}\frac{h(1+2h\sin\frac{1}{h})-0}{h}=1$$ Which follows from L'Hopital's rule. You could also solve by rearranging the expression $$\lim_{h\to0}\frac{h(1+2h\sin\frac{1}{h})-0}{h}= \lim_{h\to0}\left(1+\frac{2h^2\sin\frac{1}{h}}{h}\right)$$ $$= 1+\lim_{h\to0}2h\sin(\frac{1}{h})=1+0$$

0
On

Colton's answer gives a solution to the problem but does not explain why your approach is wrong. Allow me to do that.

Clearly the function $f$ is differentiable whenever $x \neq 0$.

This means that the number $f'(x)$ is well defined for all $x \neq 0$. This however does not mean that we have $$f'(0) = \lim_{x \to 0 } f'(x).$$

Even if the function $f$ was differentiable at $0$, it is possible that $f'$ is not continuous so you would have $$ f'(0) \neq \lim_{x \to 0}f'(x).$$

Your approach is based on the assumption that $f'$ is continuous at $0$. This is problematic because $f'$ might not be defined at $x = 0$ (in which case what do we even mean by $f'$ continuous at $0$ ???)

The better approach is to find an $a \in \mathbb R$ such that $f'(0)$ exists. That is, you should find a value of $a$ such that the limit

$$ \lim_{x \to 0} \frac{f(x)-f(0)}{x-0}$$ exists. This is what Colton did in his answer.