In these last years a big interest has appeared for studying discontinuous differential systems , that is differential equations with discontinuous right-hand sides . This interest has been stimulated by discontinuous phenomena in control systems , impact and friction mechanics , nonlinear oscillations , economics , and biology , and it has become certainly one of the common frontiers between Mathematics , Physics and Engineering . Here we develop the averaging theory of first and second order for studying the periodic solutions of discontinuous piecewise differential systems in arbitrary dimension and with an arbitrary number of systems with the minimal conditions of differentiability. We also provide two applications.