finding limits algebraically as x tends to 2 or infinity I saw the following example of finding limits algebraically in a math text book(Pure mathematics)by J.K Backhouse and S.P.Houldsworth
f(x)=(2x)/(1+x)
example 1  if we put in values of x as they tend to 2 in the above function we see that f(x) tends to twelve
The author divides the numerator and the denominator by x giving us
f(x)=(2)/((1)/(x)+1)
in the above function he lets x tend to infinity and we see that f(x) tends to 2
example 2
f(X)=(x^3-8)/(x-2) as x tends to 2 f(x) tends to 12
Here's the confusing part the author in the example says let x be 2+h
leading to
=12+6h+h^2
he lets h tend to 0 and in doing so f(x) tends to 12 somehow
I am finding it really difficult to understand the above examples

In example 1, after dividing numerator and denominator by $x$ you have $$\frac{2}{\frac1x+1}$$  And since as $x$ tends to infinity $\frac1x$ tends to $0$, you can see $\frac{2}{\frac1x+1}$ tends to $\frac{2}{0+1} = 2$. In example 2, where $$f(x)= \frac{x^3-8}{x-2}$$you are looking for lim$f(x)$ as $x$ tends to $2$. But letting $x=2$ only gives $\frac00$. So we let $x$ = $2+h$ and watch what happens as $h$ tends to $0$. Substituting $2+h$ for $x$ gives$$\frac{(2+h)^3-8}{(2+h)-2}=\frac{12h+6h^2+h^3}{h} = 12+6h+h^2$$  And since as $h$ goes to $0$, $6h$ and $h^2$, and hence also their sum, goes to $0$, therefore $12+6h+h^2$ tends to $12$ as $h$ tends to $0$.
