<s>[INST] Definition of limit with$ f(x)=|x^3|$ Using the definition of the limit I tried to find the derivative of $f(x)=|x^3|$. I came up with: $$f'(x)=\frac{3x^5}{|x^3|}$$
Question: Why is the derivative (according to this answer) not defined for $x=0$ (division by zero) while $f'(0)$ actually exists, since: $$f'(0)=\lim_{x\to 0}\frac{|x^3|-|0^3|}{x-0}=0$$
Elaboration using the definition of the limit:
$$f'(x)=\lim_{h\to 0}\frac{|(x+h)^3|-|x^3|}{h}$$
$$=\lim_{h\to 0}\frac{\sqrt{(x+h)^6}-\sqrt{x^6}}{h}$$
$$=\lim_{h\to 0}\frac{(x+h)^6-x^6}{h(\sqrt{(x+h)^6}+\sqrt{x^6})}$$
$$=\lim_{h\to 0}\frac{h^5 + 6 h^4 x + 15 h^3 x^2 + 20 h^2 x^3 + 15 h x^4 + 6 x^5}{(\sqrt{(x+h)^6}+\sqrt{x^6})}$$
$$=\frac{6x^5}{2\sqrt{x^6}}=\frac{3x^5}{|x^3|}$$
Which is not defined for $x=0$.
 [/INST] Let's tackle first the problem for $x=0$. Observe that $|a^3|=a^2\,|a|$, so
$$
f'(0)=\lim_{h\to0}\frac{|(0+h)^3|-0}{h}=
\lim_{h\to0}\frac{|h^3|}{h}=
\lim_{h\to0}\frac{h^2\,|h|}{h}=\lim_{h\to0}h\,|h|=0
$$
For $x\ne0$:
\begin{align}
f'(x)
&=\lim_{h\to0}\frac{\sqrt{(x+h)^6}-\sqrt{x^6}}{h}\\[6px]
&=\lim_{h\to0}\frac{(x+h)^6-x^6}{h(\sqrt{(x+h)^6}+\sqrt{x^6})}\\[6px]
&=\lim_{h\to0}\frac{h(6x^5+hp(x,h))}{h(\sqrt{(x+h)^6}+\sqrt{x^6})}\\[6px]
&=\lim_{h\to0}\frac{6x^5+hp(x,h)}{\sqrt{(x+h)^6}+\sqrt{x^6}}\\[6px]
&=\frac{6x^5}{2|x|^3}=\frac{3x^5}{x^2|x|}=\frac{3x^3}{|x|}
\end{align}
(where $p(x,h)$ is some polynomial in $x$ and $h$ that you can compute explicitly).
</s>