I was to find the derivative at $x=0$.
$$f(x) = \begin{cases} \dfrac{1-\cos(x)}{x}, & \text{if $x\ne 0$} \\ 0, & \text{if $x$ is equal to zero} \end{cases}$$
I approached the solution by taking the following limit as for the derivative of the above function to exist at $x=0$, the limit must have existed.
$$\lim \limits_{h \to 0}\frac{f(x+h)-f(x)}{h} =\lim \limits_{h \to 0}\frac{\frac{1-cos(x+h)}{x+h}-0}{h}.$$
Put $x=0$, and simplify and we get this:
$$\lim \limits_{h \to 0}\frac{1-\cos(h)}{h^2}$$
Now apply the limit and we get the following fraction:
$$\frac{1-1}{0}=\frac{0}{0}=\infty.$$
So, the limit clearly doesn't exist and so as far as I can tell, the derivative of the function at x=0 also doesn't exist.
But you know what? I got zero on that question and the teacher won't tell me anything but to keep practicing to get better.
Help me understand please.
$$\frac00$$ is not infinity. If I take any number $x$ and multiply by $0$, then I get $0$. So we say that $0/0$ is undefined.
Here are the rules.
Suppose that $f(x)\to a$ and $g(x)\to b$.
If $b\ne 0$, then $\frac{f(x)}{g(x)}\to\frac{a}{b}$
If $a\ne 0$ and $b=0$, then $\frac{f(x)}{g(x)}\to\infty$
If $a=0$ and $b=0$, then we can't immediately say anything about the limiting behaviour of $\frac{f(x)}{g(x)}$. In this case, it can be useful to use L'Hôpital's rule: