Wigner distribution for ordinary linear differential equations and wave equations