# Homework Help: Calculate limit of piecewise function

1. Apr 24, 2016

### lep11

1. The problem statement, all variables and given/known data
a.) Let $f,g:ℝ→ℝ$ such that $g(x)=sin x$ and $f(x)= \left\{ \begin{array}{ll} x^2, x∈ℚ \\ 0 , x∈ℝ\setminusℚ \\ \end{array} \right.$. Calculate $\lim_{x \rightarrow 0} \frac{f(x)}{g(x)}$.

b.) Why l'Hospital rule cannot be applied here?

3. The attempt at a solution
$\lim_{x \rightarrow 0} sinx=0$

$\lim_{x \rightarrow 0} f(x) =\left\{\begin{array}{ll} 0, x∈ℚ \\ 0 , x∈ℝ\setminusℚ \\ \end{array} \right.$

How to begin? I suppose I cannot apply l'Hospital.

Last edited: Apr 24, 2016
2. Apr 24, 2016

### andrewkirk

If you think about the values of $f(x)$ just on rational values of $x$, it should become apparent what the limit must be, if there is a limit. Call that number $l$. Then prove that $l$ actually is the limit by an explicit $\epsilon$-$\delta$ argument.

3. Apr 24, 2016

### lep11

The limit of $\frac{f(x)}{g(x)}$ is 0, right?

Last edited: Apr 24, 2016
4. Apr 24, 2016

### Ray Vickson

l'Hospital's rule does not apply because $f(x)$ is not a differentiable function.

5. Apr 24, 2016

### lep11

Yes, $f$ is continuous and differentiable only at x=0 which is not sufficient.

Last edited: Apr 24, 2016
6. Apr 24, 2016

### Ray Vickson

Right, because l'Hospital's rule talks about $\lim_{x \to 0} f'(x)$, not just $f'(0)$ (at least as it is usually presented).

7. Apr 24, 2016

### andrewkirk

You are correct. So now you need to prove it, using an $\epsilon$-$\delta$ argument. That is, prove that, for any $\epsilon>0$ you can find a $\delta>0$ such that $|x|<\delta\Rightarrow\frac{f(x)}{g(x)}<\epsilon$.

8. Apr 25, 2016

### lep11

If $x∈ℝ\setminusℚ$, then $\lim_{x \rightarrow 0}\frac{f(x)}{g(x)}=\lim_{x \rightarrow 0}\frac{0}{sinx}=\lim_{x \rightarrow 0}0=0$ That's trivially true.

If $x∈ℚ$, then $\lim_{x \rightarrow 0}\frac{f(x)}{g(x)}=\lim_{x \rightarrow 0}\frac{x^2}{sinx}=0$ (an educated guess)

Proof: Let $ε>0$ arbitrarily. Let $δ=+\sqrt(ε|sinx|)$

$|\frac{x^2}{sinx}|=\frac{x^2}{|sinx|}<ε$, when $|x|<δ=\sqrt(ε|sinx|)$.

My proof doesn't look very elegant, does it?

Last edited: Apr 25, 2016
9. Apr 25, 2016

### andrewkirk

$\delta$ cannot be a function of $x$, as $x$ is not defined in that context. You either need a more careful $\epsilon$-$\delta$ argument, or you can use l'Hopital on $\frac{x^2}{\sin x}$, use that to infer an $\epsilon$-$\delta$ relationship and apply that to the restricted domain of $\mathbb{Q}$.