Given function $y[n]$ what is the best way to define the second derivative?
Some background to the question: in linear systems we often sample a continuous signal to a discrete one with sample rate of $T_s$, and then use Z-transform to find the output. So, given a system defined by a second derivative, how to transform it?
There is no even first derivative if the function is no continuous.
The mathematically consistent derivative(s) of a piecewise-constant function is proposed within theory of generalized functions (not sure about right translation of the term into english) where one get delta-function as a derivative of Heaviside step function.
Nevertheless within numerical schemes for solving problems PDE one uses such a presentation $$y'_{n}=(y_{n+1}-y_{n-1})/(2h) \approx (y_{n+1}-y_{n})/h \approx (y_{n}-y_{n-1})/h$$ and $$y''_{n}=(y'_{n+1}-y'_{n-1})/(2h)=( (y_{n+2}-y_{n})/(2h) - (y_{n}-y_{n-2})/(2h))/(2h) = (y_{n+2}+y_{n-2}-2y_{n})/(4h^2)$$ or with some notes write it as $$ y''_{n}=(y_{n+1}+y_{n-1}-2*y_{n})/(h^2)$$