I am currently trying to calculate the following limit (we are the whole time working in $\mathbb{R}$):
$$\lim_{x\rightarrow 4}\frac{\sqrt{1+2x}-3}{\sqrt{x}-2}$$
My lecturer is uploading handwritten notes with some examples where she just writes down limits without any explanations. It looks like in some cases we can just substitute the (in this case) $4$ for the $x$ and get the limit and in other cases we can't. I did rewrite the function to $\frac{2(\sqrt{x}+2)}{\sqrt{1+2x}+3}$ substituted the $4$ and got $\frac{4}{3}$ as limit.
But sadly in her examples are few to no explanations and from my perspective I don't really understand the substituting. How can I comprehensible explain why I am currently substituting with the $4$? It just doesn't feel right for me to just say "I just substitute with the $4$ and if I am lucky I get the correct limit. If I get something undefined I just rewrite the function such that it works." When am I allowed to substitute and why am I allowed to substitute?
From my understanding we can always substitute the $4$ for the $x$ when we know that the limit exists. And the limit exists if the right-hand limit is equal to the left-hand limit. That means I first have to calculate the left-hand limit and right-hand limit.
But how do I calculate the right-hand limit and left-hand limit? In the examples I was given we just sometimes substitute again and sometimes not, so I am at the same problem.
For example we have one example where we just substitute (this is the full example there is nothing more written to it):
Let $f:\mathbb{R}\rightarrow\mathbb{R}, x\mapsto x^2-3x+2$. Let $(x_{n})$ with $x_n\nearrow 2\Rightarrow\lim_{n\rightarrow\infty}f(x_n)=\lim_{n\rightarrow\infty}f(2)=0$. The same for $x_n\searrow 2$. Together $\lim_{x\rightarrow 2}f(x)=0$.
Okay it looks like we are calculating the right-hand limit and left-hand limit and because they are equal we can calculate the limit as $x$ is approaching $2$. But for the left-hand limit and right-hand limit I am just substituting $2$ again and I don't get why. It seems so not rigorous to me.
Here is a second example:
Let $f:\mathbb{R}\rightarrow\mathbb{R}, x\mapsto\lfloor x\rfloor$. For $\hat{x}=1, \lim_{x\nearrow 1}f(x)=0$ and $\lim_{x\searrow 1}f(x)=1$. $1\neq 0\Rightarrow \text{no limit}$.
I understand in this example why the left-hand limit is $0$, because we are approaching $1$ from below we are always near $1$ but still always below $1$. So we have to round down to $0$. And the other way around we are always bigger then $1$ but also near $1$ so we have to round down to $1$.
Here it is still easy to see that I can't just substitute with $1$. But I couldn't explain why. I would just see that we have like these different values. But what if we have a more difficult function whichs limit doesn't exist? For example $\lim_{x\rightarrow\infty}\sqrt{\sin{x}^2-1}$? And even if this limit would exist I can't just substitute infinity so how to handle that?
In general I think that my lecturer just wants me to rewrite the function and then substitute the $4$ without thinking much and I would get full marks for the result $\frac{4}{3}$. But this looks not rigorous from my perspective. When am I allowed to just substitute and why am I allowed to substitute? How to handle cases where I have the values going against infinity?
I think that I read that it has somewhat to do with continous functions, but we didn't talk about them in the lecture. And the function which I should analyse is not continous I think and the one in the first example is continous.
I tried to write a rigorous (shortend) solution for the following: Let $f:\mathbb{R}\rightarrow\mathbb{R}, f(x)=\frac{\sqrt{1+2x}-3}{\sqrt{x}-2}$. I want to calculate $\lim_{x\rightarrow 4}\frac{\sqrt{1+2x}-3}{\sqrt{x}-2}$. I then show that $f$ is not continous for $x=4$, hence I can not substitute with $x=4$. I then consider the function $g:\mathbb{R}\rightarrow\mathbb{R}, g(x)=\frac{2(\sqrt{x}+2)}{\sqrt{1+2x}+3}$ whichs only difference is that it is continous for $x=4$. So now I thought that I can just substitute with $x=4$ and get $\frac{4}{3}$. But the function is still not continous for all $x$. If $x$ gets negative it's discontinous. But my question now is, is it important that the function is continous for all $x$ or only continous for $x=4$. And as soon as it is continous for $x=4$ I can substitute with $x=4$. Because $x$ approaches $4$ I dont have to care about negative values, because 4 is positive?