Find the $n$th derivative for the function $y=\sin(kx)$, $n\in\mathbb{R}$. I created a question for a high school calculus exam:
Find the $n$th derivative, $\dfrac{d^ny}{dx^n}$, for the function $y=\sin(kx)$, $n\in\mathbb{N}$.
The solution:
\begin{align}
\dfrac{d}{dx}\sin(kx)&=k\cos(kx) =k\sin k(x+\frac{\pi}{2})\\
\dfrac{d^2}{dx^2}\sin(kx)&=\dfrac{d}{dx}k\sin k(x+\frac{\pi}{2})=k^2\cos k(x+\frac{\pi}{2})=k^2\sin k(x+\pi)\\
\vdots \\
\dfrac{d^n}{dx^n}\sin(kx)&=k^n\sin k(x+\frac{n\pi}{2})
\end{align}
One of my students had asked me "Why did you include $n\in\mathbb{N}$ in the question?  Does that mean it's possible to be asked for $n\in\mathbb{R}$ later on?"
I'm aware of the existence of the fractional derivative, but I'm unable to give it any meaning or explain it.  So the problem I want to find a solution for is (and I'm totally aware that this is well beyond any high school calculus content):

Find the $n$th derivative for the function $y=\sin(kx)$, $n\in\mathbb{R}$.
BONUS:  Find the $n$th derivative for the function $y=x^2e^x$, $n\in\mathbb{R}$.

 A: On wikipedia you will find many different definitions and examples, of which not all will coincide. Some will even depend on different parameters that don't have any effect for natural $n$. Using the direct Grünwald–Letnikov derivative, we have:
\begin{align}\mathbb D^q\sin(kx)&=\lim_{h\to0}\frac1{h^q}\sum_{m=0}^\infty(-1)^m\binom qm\sin[k(x-mh)]\\&=\Im\lim_{h\to0}\frac1{h^q}\sum_{m=0}^\infty(-1)^m\binom qme^{ikx-ikmh}\\&=\Im\lim_{h\to0}\left[\frac{1-e^{-ikh}}h\right]^qe^{ikx}\\&=\Im[(ik)^qe^{ikx}]\\&=\Im[k^qe^{i(kx+q\pi/2)}]\\&=k^q\sin\left(kx+\frac{q\pi}2\right)\end{align}
as claimed. Similarly,
\begin{align}\mathbb D^qx^2e^x&=\lim_{h\to0}\frac1{h^q}\sum_{m=0}^\infty(-1)^m\binom qm(x-mh)^2e^{x-mh}\\&=\lim_{t\to1}\frac{\mathrm d^2}{\mathrm dt^2}\lim_{h\to0}\frac1{h^q}\sum_{m=0}^\infty(-1)^m\binom qme^{(x-mh)t}\\&=\lim_{t\to1}\frac{\mathrm d^2}{\mathrm dt^2}\lim_{h\to0}\left[\frac{1-e^{-ht}}h\right]^qe^{xt}\\&=\lim_{t\to1}\frac{\mathrm d^2}{\mathrm dt^2}t^qe^{xt}\\&=(x^2+2qx+q(q-1))e^x\end{align}
A: There is no reason whatsoever to use a complicated formulas instantly. Especially not from the educational point of view. Fractional derivative is a natural extension of integer derivative, and there is not much to say there.
If $f^{(n)}(x)=g(x,n), n \in \mathbb{N}$ is $n^{th}$ derivative of $f(x)$, then the fractional derivative of $f(x)$, in various notations, is $ \left ( \mathbb{D}^r \right ) f(x)=\frac{d^r}{dx^r}f(x)=f^{(r)}(x)=g^*(x,r), r \in \mathbb{R}$. where $g^*$ is an extension of $g$ from integers to reals.
(We could use the same and define other derivatives like complex ones.)
The only purpose of deriving a more general formula is to have a proof that such derivative is mathematically sounded object. But for ordinary functions, it is as simple as the above statement. This is because the fractional derivative is defined as an extension itself, albeit a more generic one that uses the least possible amount of ammunition.
(The only question here is which $g^*$ to use and if it is sufficiently generic.)
From the educational point of view, this shows the direction we want to go, and it is very logical and substantial. After this explanation, it is much more clear why we need to introduce a more generic way of treating all functions the same way, rather than trying to guess in each particular situation, for more complicated functions, what this extending function to reals contains.
Therefore
$$\left( \mathbb{D}^r \right ) \sin(kx)=k^r\sin(kx+\frac{r\pi}{2})$$
$$\left( \mathbb{D}^r \right ) x^2e^x=e^x((x+r)^2-r)$$
In-depth reasoning: in more generic formulae, fractional derivative, in general, is continuous over reals, there is nothing in particular that makes integers different from reals and the only needed extension is, for example, a trivial one, like Gamma function, i.e. factorial.
$$\left( \mathbb{D}^r \right ) f( x )  = \frac1{ \Gamma ( r ) } \int_0^x \left(x-t\right)^{r-1} f(t) \, dt$$
Regarding generality we talked about, this apparently trivial one is a good illustration.
It is not true that $\left( \mathbb{D}^r \right ) 1 = 0$. Meaning, we need to start from a more generic form before we can define the situation.
$$ \left( \mathbb{D}^r \right ) x^k = \frac{d^r}{dx^r}x^k=\frac{k!}{(k-r)!}x^{k-r} $$
and now for $k=0$
$$ \frac{d^r}{dx^r}x^0=\frac{d^r}{dx^r}1=\frac{0!}{(0-r)!}x^{0-r}=\frac1{(-r)!}x^{-r}=\frac1{\Gamma(1-r)}x^{-r} $$
(There is some strange belief that we are allowed to introduce a "simple" mathematical object in a simple way, yet more intricate in a complex way. The truth is that all mathematical objects are complex if we want them to be complex, and if humanity needed to learn these starting from simpler notions, why would a 21st century kid have to be smarter than geniuses of old and digest all that at once? No, the fact that we know it does not make it easier to digest. As a student, I would not say a word if you would introduce fractional derivatives as above, but I would object a direct introduction into formulas I can barely decipher after first view.)
