# Differentiation of discrete sinusoidal signal

What I understand from differentiation of discrete sinusoidal signal is $y(n) = \alpha(x(n)-y(n-1))$ where $\alpha$ may be a factor depending on sampling frequency and signal frequency. Now y(n) represents signal which is $90^\circ$ phase shifted sinusoid.

My question is why to go to Hilbert transform and other complex methods to shift a signal $90 ^\circ$. My concern is with $50\,\text{Hz}$ signal only till $40$-th harmonic.

$$\mathcal{F}\left[\tfrac{d}{dt} f(t)\right](u) = -iw \mathcal{F}[f(t)](u)$$ $$\mathcal{F}\left[\mathcal{H}[f](t)\right](u) = -i\frac{w}{|w|} \mathcal{F}[f(t)](u)$$
We can see that for a sinusoid of frequency $w_0$, the derivative is the Hilbert transform scaled by $w_0$. e.g. Hilbert transform of $\cos(n t) = -\sin(n t)$, derivative of $\cos(n t) = -n \sin(nt)$. So careful choice of alpha in your formula will give you the phase shift, while compensating for the scaling by frequency, which is the same as the Hilbert transform.