On the L^p-differentiability of certain classes of functions