# Calculate limit of piecewise function

## Homework Statement

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?

## The Attempt at a Solution

##\lim_{x \rightarrow 0} sinx=0##[/B]

##\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:

andrewkirk
Homework Helper
Gold Member
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.

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.
The limit of ##\frac{f(x)}{g(x)}## is 0, right?

Last edited:
Ray Vickson
Homework Helper
Dearly Missed

## Homework Statement

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?

## The Attempt at a Solution

##\lim_{x \rightarrow 0} sinx=0##[/B]

##\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.

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

l'Hospital's rule does not apply because ##f(x)## is not a differentiable function.
Yes, ##f## is continuous and differentiable only at x=0 which is not sufficient.

Last edited:
Ray Vickson
Homework Helper
Dearly Missed
##f## is continuous and differentiable only at x=0.
Yes, ##f## is continuous and differentiable only at x=0 which is not sufficient.

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).

andrewkirk
Homework Helper
Gold Member
The limit of ##\frac{f(x)}{g(x)}## is 0, right?
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##.

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:
andrewkirk