# Method to show that a limit exisits and evaluate the limit of a normal function and a piecewise function as x tends to point

Exam Question:

For each of the following functions f , determine whether $\lim_{x\to a}f(x)$ exists, and compute the limit if it exists. In each case, justify your answers.

a) $f(x)= \dfrac{x+2}{\sqrt{6x+2}-2}$ $\text{where a = -2}$

b) $f(x)=$$\begin{cases}x^2,&\text{if x is irrational} \\2x+1,&\text{if x is rational}\end{cases}$ $\text{a=0}$

Attempt:

a) I'm Assuming you rationalise the denominator, and do some jiggery pokery, according to wolfram alpha the limit it $0$.

b) The graph of this equation shows that you may be able to prove the limit as $x$ approaches the right and left hand side. I think you do this by choosing a sequence for each side of the graph. If both sequences converge then well done.

What is the correct method to answer this question, surely you don't just substitute the points into the equation, do you show continuity first, and then you can substitute as much as you want?

For the first one: are you sure you didn't make a mistake? Because $f(x)$ exists only if $6x+2 \geq 0$ (because of the square root), which implies $x \geq -\frac{1}{3}$. So $f$ is NOT defined in a neighbourhood of $-2$, therefore the limit does not exist...
For the second one: $\mathbb{Q}$ and $\mathbb{R}-\mathbb{Q}$ are dense in $\mathbb{R}$, so there exists a sequence of rational numbers $(x_n)_n$ and a sequence of irrational numbers $(y_n)_n$ that both converge to $0$. But $f(x_n)=2x_n+1$ converges to 1 as $n \rightarrow \infty$, where as $f(y_n) = y_n^2$ converges to $0$. These two different limits ($0$ and $1$) prove that $f$ has no limit when $x \rightarrow 0$.