function with floor - differentiable? Question:
Calculate the derivatives of the following functions (specify domain):
a. $\lfloor x^2 \rfloor \sin^2(\pi x)$
b. {$x^2 $}$\sin^2(\pi x)$
What I did:
on a. If $x \in \Bbb N$ then the function equals 0 (because of the sine). If $x \notin \Bbb N$ then I need to calculate the limit $\lim_{h \to 0}\frac {f(x+h)-f(x)}h$ which I'm having trouble calculating, as both the numerator and denominator are going to be 0.
on b. I divided to the same cases and when x is an integer it's also 0. But this time I think I can just say that it's differentiable for $x \in \Bbb R \setminus \Bbb N$ and simply remove the braces in my calculation. Am I correct?
 A: First, some comments on your work so far:


*

*For part (a), your observation that the function is $0$ when $x \in \mathbb{N}$ is true, but irrelevant.  You don't care about the function's value -- you only care about its derivative, and whether or not it exists.

*For part (b), you are incorrect (though I think you may mean something different than what you said).  Again you cannot rule out the case $x \in \mathbb{N}$ simply by observing that the function takes on the value $0$.  Moreover, the function is not differentiable in all of $\mathbb{R} \setminus \mathbb{N}$.
Now, here are some hints.


*

*For part (a), note that if $a^2 \in \mathbb{N}$, then $f(x) = \lfloor x^2 \rfloor \sin^2 (\pi x)$ is not continuous at $x = a$ (why?); therefore, $f$ is not differentiable at $x = a$.
Then, in the case where $a^2 \not \in \mathbb{N}$, observe that $\lfloor x^2 \rfloor$ is constant on a some small interval containing $a$.
Therefore, you can just treat $\lfloor x^2 \rfloor$ as a constant when computing $f'(a)$.

*For part (b), you can take an easy shortcut.  Just write
$$
\{x^2\}\sin^2(\pi x) = x^2 \sin^2(\pi x) - \lfloor x^2 \rfloor \sin^2(\pi x)
$$
You know the derivative of $x^2 \sin^2(\pi x)$ and that it exists everywhere.  Also, you know the derivative of $\lfloor x^2 \rfloor \sin^2(\pi x)$ and exactly when it exists.  So you should be done.
