# Limits involving trigonometric functions $f(x)=\lfloor{x^2 \rfloor} \sin^2(\pi x)$

I was asked to find for what values of x the function is differentiable and write down the derivative.

$f(x)=\lfloor{x^2 \rfloor} \sin^2(\pi x)$ for $x \geq 0$.

There are two steps:

• When $x \in (\sqrt{n},\sqrt{n+1})$ we get $f'(x)=\pi n \sin(2 \pi x)$.
• If $x=\sqrt{n}$ then:
• I need to find $\lim_{x \rightarrow \sqrt{n}^+} \frac{f(x)-f(\sqrt{n})}{x-\sqrt{n}}=\lim_{x \rightarrow \sqrt{n}^+} \frac{n \sin^2(\pi x)-n \sin^2(\pi \sqrt{n})}{x-\sqrt{n}}$
• I need to find $\lim_{x \rightarrow \sqrt{n}^-} \frac{f(x)-f(\sqrt{n})}{x-\sqrt{n}}=\lim_{x \rightarrow \sqrt{n}^-} \frac{(n-1) \sin^2(\pi x)-n \sin^2(\pi \sqrt{n})}{x-\sqrt{n}}$

I just don't know how to find the limits :\ We haven't covered L'hopital yet, so I need to use other methods.

Of course, after finding both limits, we need to write $f'_{-}(\sqrt{n})=f'_{+}(\sqrt{n})=f'(\sqrt{n})=\pi n \sin(2\pi \sqrt{n})$. This is true if and only if $\sqrt{n} \in \mathbb{N}$ (limits are all 0), otherwise the function is not differentiable in $x=\sqrt{n}$.

Please show how to continue, thanks!

• – GinKin Dec 28 '13 at 12:47

## 2 Answers

\begin{align} \lim_{x\to\sqrt n^+}\frac{f(x)-f(\sqrt n)}{x-\sqrt n}&=\lim_{x\to\sqrt n^+}\frac{n\sin^2(\pi x)-n\sin^2(\pi \sqrt n)}{x-\sqrt n}\\ &=n \frac{\text d}{\text dx}\sin^2(\pi x)|_{x=\sqrt n}\\ &=2\pi n\sin(\pi \sqrt n)\cos(\pi\sqrt n)=\pi n\sin(2\pi\sqrt n) \end{align} However, the limit below is: \begin{align} \lim_{x\to\sqrt n^-}\frac{f(x)-f(\sqrt n)}{x-\sqrt n}&=\lim_{x\to\sqrt n^-}\frac{(n-1)\sin^2(\pi x)-n\sin^2(\pi \sqrt n)}{x-\sqrt n}\\ &=\lim_{x\to\sqrt n^-}\frac{n\sin^2(\pi x)-n\sin^2(\pi \sqrt n)}{x-\sqrt n}-\frac{\sin^2(\pi x)}{x-\sqrt n}\\ &=\lim_{x\to\sqrt n^-}\pi n\sin(2\pi\sqrt n)-\frac{\sin^2(\pi x)}{x-\sqrt n}\\ \end{align} If $$n=0$$, then we have $$\lim_{x\to 0}\frac{\sin^2(\pi x)}{x}=\lim_{x\to0}\frac{(\pi x)^2}{x}=\lim_{x\to 0}\pi^2x=0.$$
Otherwise, the limit approaches infinity since $$\sin^2(\pi x)$$ approaches a nonzero finite value, while the denominator approaches $$0$$.

• It seems like you have used the L'hopital rule, but we are not supposed to use it as we haven't cover it yet. Is there other method? – Galc127 Dec 26 '13 at 20:07
• This doesn't use L'Hopital. It's well-known that $\sin x$ is asymptotic to $x$ around $0$, otherwise this is just evaluating derivatives. – Tim Ratigan Dec 26 '13 at 20:11
• It still not clear to me... Why can you write the derivative? – Galc127 Dec 26 '13 at 20:12
• What part isn't clear to you @Galc127? – Tim Ratigan Dec 26 '13 at 20:21
• By definition, $$\frac{\text d\sin^2(\pi x)}{\text dx}\big|_{x=\sqrt n}=\lim_{x\to\sqrt n}\frac{\sin^2(\pi x)-\sin^2(\pi \sqrt n)}{x-\sqrt n}$$ @Galc127 – Tim Ratigan Dec 26 '13 at 22:33

Both $\lfloor x^2\rfloor$ and $\sin^2(\pi x)$ are differentiable everywhere, except $\lfloor x^2\rfloor$ which is not differentiable when $x^2$ is a non-zero integer. So all we need to check is whether the given function is differentiable when $x^2$ is a non-zero integer.

Suppose that $x_n^2=n$, where $n$ is not a perfect square. $x_n$ is not an integer and so $\sin^2(\pi x_n)\ne0$. At $x_n$, $\lfloor x^2\rfloor\sin^2(\pi x)$ tends to $(n-1)\sin^2(\pi\sqrt{n})$ from the left and $n\sin^2(\pi\sqrt{n})$ from the right. Thus, the function is not even continuous at $x_n$ if $n$ is not a perfect square.

Suppose that $x_n^2=n$, where $n$ is a perfect square. $x_n$ is an integer and so $\sin^2(\pi x_n)=0$. At $x_n$, $\lfloor x^2\rfloor\sin^2(\pi x)$ tends to $0$ from the left and the right. Therefore, the function is continuous. From the left, the derivative tends to $2\pi(n-1)\sin(\pi x_n)\cos(\pi x_n)=0$ and from the right, the derivative tends to $2\pi n\sin(\pi x_n)\cos(\pi x_n)=0$. Thus, the Mean Value Theorem says that the derivative at $x_n$ is $0$.

Thus, the function is differentiable at all points except non-integers whose squares are integers.

Where differentiable, the derivative would be $$2\pi\lfloor x^2\rfloor\sin(\pi x)\cos(\pi x)=\pi\lfloor x^2\rfloor\sin(2\pi x)$$ Note that except at the troublesome points $\lfloor x^2\rfloor$ is a constant, so the formula above only considers the derivative applied to $\sin^2(\pi x)$.

• What an amazing solution, thanks a lot! – Galc127 Dec 27 '13 at 11:31
• Why the derivative from the left is $2\pi(n-1)\sin(\pi x_n)\cos(\pi x_n)$ ? Shouldn't it be just n instead of (n-1) ? BTW that hat/wig on your avatar is hilarious. – GinKin Dec 28 '13 at 12:58
• @GinKin: to the left of $x_n$, $\lfloor x^2\rfloor$ is a constant $n-1$ and to the right of $x_n$, $\lfloor x^2\rfloor$ is a constant $n$. – robjohn Dec 28 '13 at 14:03