Confusion regarding solving limit problems I have a doubt that while solving limit question like 
   $$\lim_{h\to 0}\frac{(x+h)^2-x^2}{h}$$
we at one place of our solution substitute $h=0$ (at the end) but when to do that substitution is my doubt.
 A: Hint: Considering that $h$ is not zero but tends to $0$ then, $$\lim _{h\to 0} \frac{\left(x+h\right)^2-x^2}{h} =\lim _{h\to 0}=\frac{\not h\left(2x+h\right)}{\not h}=2x$$
A: When you evaluate
$$\lim_{h\to 0}\frac{(x+h)^2-x^2}{h}$$
you are evaluating the expression 
$$\frac{(x+h)^2-x^2}{h}$$
as $h$ approaches $0$. It is not true that $h$ is equal to $0$. The notation 
$$\lim_{h\to 0}$$ means that $h$ will get closer and closer to $0$ but will never actually be equal to $0$. In order to evaluate the limit you should first expand and simplify the numerator
$$\frac{(x+h)^2-x^2}{h}=\frac{x^2+2xh+h^2-x^2}{h}=\frac{2xh+h^2}{h}=\frac{h(2x+h)}{h}$$
then divide out the $h$ from both the numerator and denominator
$$2x+h$$
from which you can now take the limit as $h\to 0$ to form
$$2x$$
A: You can't evaluate the limit until after you've cancelled the $h$ out of the denominator.  For instance, if you try to evaluate the limit right from the start: 
$$\lim _{h\to 0} \frac{\left(x+h\right)^2-x^2}{h} =\frac{(x+0)^2-x^2}{0}=\frac{x^2-x^2}{0}=\frac00$$ 
In order to get an answer that isn't indeterminate, you need to do the algebra first.
$$\lim _{h\to 0} \frac{\left(x+h\right)^2-x^2}{h} = \lim _{h\to 0} \frac{(x^2+2xh+h^2)-x^2}{h} \\=\lim _{h\to 0} \frac{h(2x+h)}{h} =\lim _{h\to 0} (2x+h)=2x$$
A: You do that substitution when it is possible to do it. As your ratio stands, you cannot since $h$ is in the denominator. So you first simplify the expression to get $$\frac{(x+h-x)(x+h+x)}{h}=\frac{h(2x+h)}{h}=2x+h.$$ Now it is safe to do such a substitution.
However (and this is important!) what we're actually doing here is not making a substitution. What we're doing is making $h$ as small as we please, and noting what happens to our fraction. In this case, it is easy to see that as $h$ goes to $0,$ then $2x+h$ gets near to $2x.$ We therefore say that $2x$ is the limiting value of our fraction as $h$ approaches $0.$
