Question about limits in Indeterminate form The derivative of a function $f(x)$ is defined as $\normalsize \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}$, substituting with $h=0$ yields the indeterminate form $\frac{0}{0}$, so we try to do some algebraic manipulation to cancel the $h$ in the denominator and substitute again with $h=0$, hoping that we will get some valid value.
However, according to my understanding, it is not clear that this is valid, since we were not allowed to substitute with $h=0$ in the first place since $\normalsize \frac{f(x+h) - f(x)}{h}$ is not defined at $h=0$,so why in the end we are allowed to do this substitution?
For example if we have $f(x) = x^2$ then $\normalsize \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}$ = $\normalsize \lim_{h \to 0} \frac{(x+h)^2 - x^2}{h}$ = $\normalsize\lim_{h \to 0} \frac{2xh +h^2}{h}$ = $\normalsize \lim_{h \to 0} {2x + h}$, and we substitute with $h=0$ to get the result $2x$ : why are we allowed to make this substitution now?
As I understand, we can prove that this process is valid with some $\epsilon$ and $\delta$ proof, but what troubles me is that I found multiple calculus textbooks making this substitution without justifying it at all, as it was clear that it is valid, while I see that this is something not immediately clear and needs to be justified, so am I missing something? Can you make a reference of some textbook that justify this process? I would like to see its proof.
Edit
I think the general statement which needs to be proved will be something like: when $f(x) = g(x)$ for all points on some interval except at $x_0$, then their limit at $x_0$ will be equal (and when g(x) is continuous at $x_0$ the limit will be of course equal to $g(x_0)$).
What is the proof of this general statement (if I'm correct and indeed this is the statement that needs to be proved)? And why it seems that calculus books ignore this issue totally
Thanks a lot
 A: This question trigged me also and it's good : it shows that you are curious !  In fact you have mentionned the key answer, something proper to analysis : the $\delta-\varepsilon$ method.
The fact is that when you take the limit of something when something else goes to $x$, you are not allowing to be equal $x$. This first explains why we need to work on the expression involved in the limit :
$$
\lim_{h\to 0}\frac{x^2 + 2xh + h^2 - x^2}{h} = \lim_{h\to 0}\frac{h\left( 2x + h\right)}{h} = \lim_{h\to 0}(2x+h) = 2x+\lim_{h\to 0}h 
$$
Now to conclude, you need to compute the limit of $h$ when $h$ tends to $0$ using the definition of the limit. A naturel guess for the limit is $0$ :
$$
\forall\varepsilon>0,\exists\delta>0,\forall h\in \mathbb{R} : \lvert h\rvert\leq\delta\implies\lvert h\rvert\leq\varepsilon
$$
The definition is thus just an implication that relies on the existence of a such $\delta$, here it is simple, juste take $\delta = \varepsilon$ !
What the mathematical expression of the limit says is that whatever the epsilon you take, you can find a neighborhood such that the implication holds.
Thus
$$
\lim_{h\to0}h = 0
$$
And you get your result. The fact to keep in mind, is that the derivative at a point is a limit process, you need to use the tool provides by analysis !

We say that the limit of a function $f(x)$ when $x$ tends to $x_0$ is $L$ when the following holds :
$$
\forall\epsilon>0, \exists\delta>0, \forall x\in\mathbb{R} : \lvert x-x_0\rvert\leq\delta\implies\lvert f(x) - L\rvert\leq\varepsilon
$$
In our case $f(x) = x$ and $x_0 = 0$. The intuition (at least for me) is exactly the same as the one provided above.

I hope this will help you ! Let me know if something is not clear !
A: Be careful: the derivative of a function at a point $x$ is defined by $f'(x):=\lim_{h \to 0} \frac{f(x+h)-f(x)}{h}$ provided that the latter limit exists and is finite. It's different from what you said.
You cannot substitute $h=0$ because the difference ratio $\frac{f(x+h)-f(x)}{h}$ is not defined at $h=0$; this has nothing to do with limits or indeterminate forms, it is something that appears way before in the theory of functions.
We can evaluate limits at a point where a function is not defined (actually, they are the most interesting cases, for instance $\lim_{x \to 0} \frac{\sin x}{x}$), because limits are defined in the so called accumulation points. Accumulation points, intuitively, are points such that you can go as near as you want to them but never reach them. So, in limits, we exclude the value where the variable tends to; that is, in $\lim_{h \to 0} \frac{f(x+h)-f(x)}{h}$ we consider $h\ne 0$.
Technically, in general you can't say that when $h \to 0 $ it is $f(x+h)\to f(x)$ because this is true only if $f$ is continuous at $x$. Hence, the substitution $h=0$ to deduce something about the value of the limit you are referring to is a tool to evaluate the limit is only if you already know the continuity at $x$ of the functions involved under the limit sign. Even assuming that $f$ is continuous at $x$, you could say that indeed that the numerator $f(x+h)-f(x)$ tends to $0$ as $h \to 0$ and the denominator $h$ tends to $0$ as $h\to 0$, but this are only separated informations on the behavior of the numerator and the denominator. In general, you cannot deduce the behavior of the limit of a ratio by the behaviors single limits of the numerator and the denominator. You can only deduce something when you can apply the algebraic theorems of limit of ratio; and guess what? Those algebraic theorems I'm referring to apply when the famous cases of the indeterminate forms don't occur.
Hence, the point is that "indeterminate form" is just a shorthand that means: "We cannot deduce the limit of a function $F$ only knowing the behavior of the single limits of the functions $f_1,f_2,...,f_n$ involved in the limit of $F$". A priori, we don't know if it exists and it is finite or infinite, or if it doesn't exist; a deeper analysis must be done when an indeterminate form appears.
So, in the context of limit defining the derivative, you think as $h\ne0$ and you are interested in what happens when $h$ becomes arbitrarily small but it is never $0$. So, using your example $f(x)=x^2$, you have:
$$(x^2)'=\lim_{h \to 0}\frac{(x+h)^2-x^2}{h}=\lim_{h \to 0}\frac{2xh+h^2}{h}=\lim_{h \to 0}\left(2x\frac{h}{h}+\frac{h^2}{h}\right)$$
Here comes the important part about accumulation points. Since $h\ne 0$, the functions $h/h$ and $h^2/h$ are equivalent, respectively, to the functions $1$ and $h$ (if this seems strange to you, just think about this: $h/h$ and $h^2/h$ are not defined at $h=0$ because the division by $0$ is not defined, hence for $h=0$ their expressions are meaningless; but, if $h\ne0$, then for any $h\ne0$ the division between two real numbers is defined and if a factor appears both in the numerator and in the denominator you can cancel it out; $h$ in the numerators and it is different from $0$, so we can cancel it out in this case. I know this seems a delirium at first, but details are important in math). So, in the limit where $h\to0$, being $0$ an accumulation point we can write:
$$\lim_{h \to 0}\left(2x\frac{h}{h}+\frac{h^2}{h}\right)=\lim_{h\to 0}(2x+h)$$
Now, you can evaluate the latter limit with the definition as follows.
Let $\epsilon>0$, choose $\delta=\epsilon$. Hence $(|h|<\delta=\epsilon) \implies (|2x+h-(2x)|=|h|<\delta=\epsilon)$. So $\lim_{h \to 0} (2x+h)=2x$. As you've seen, no substitution of $h=0$ occurs at all in all this reasoning.
