TITLE: Finding a limit using change of variable- how come it works?
QUESTION [36 upvotes]: I'm a student just starting calculus in college, and my math skills are pretty stale.
So... how come finding limits using change of variable works?
For example:
$$\lim_{x \to 1}\frac{x\cos(x-1) -1}{x-1}$$
A way to solve this is to invent "out of thin air" $t = x-1$, and then the limit above is equal to:
$$\lim_{t \to 0}\frac{(t + 1)\cos(t) - 1}{t}$$
How come this works?
A limit is not an algebraic equation. what about domains of definition? 
We are actually finding a different limit of a different function in a different place, how come they are equal (in general)?

just to clarify I'm not asking about this specific example. I'm asking in general, when can you do this to find limits? when not? and why?

REPLY [33 votes]: There is a very general result which guarantees such substitutions. Let $\lim\limits_{x \to a}f(x) = L$ exist and let $\lim\limits_{t \to b}g(t) = a$ exist and also assume that $g(t) \neq a$ when $t$ is in a certain neighborhood of $b$ then $\lim_{t \to b}f(g(t)) = L$.
Please understand that the theorem is valid only under the conditions given in the above result and one of the first conditions is that $\lim_{x \to a}f(x)$ exists. If we don't know in advance whether the limit of $f(x)$ exists then how do we make a substitution $x = g(t)$ (in this question we put $x = t + 1$)?
To answer this we need to understand that the substitution $x = g(t)$ ($x = t + 1$) used here is invertible so that we have an inverse substitution $t = h(x)$ ($t = x - 1$) with $x = g(h(x)), t = h(g(t))$ which will allow us to infer the existence of limit $\lim_{x \to a}f(x)$ on the basis of existence of limit $\lim_{t \to b}f(g(t))$ via the theorem given in the beginning of this post.
Another condition which is very very important is to ensure that $g(t) \neq a$ when $t$ is near $b$. Clearly this holds in the substitution used in the current question when $x = t + 1$ and $a = 1, b = 0$.
If we think deeply we will find that if $g(t)$ is invertible in the neighborhood of $t = b$ then it will automatically ensure that $g(t) \neq a$ in a certain neighborhood of $b$. So in practice we use the following :

Theorem: If $x = g(t)$ is an invertible function with inverse $t = h(x)$ in the deleted neighborhood of $t = b$ and $\lim\limits_{t \to b}g(t) = a, \lim\limits_{x \to a}h(x) = b$ then either both the limits $\lim\limits_{x \to a}f(x)$ and $\lim\limits_{t \to b}f(g(t))$ exist and are equal or both of them don't exist.

Note that there is no condition on $f$ for the above theorem.