In many problems appearing in applied mathematics in the nonlinear ordinary differential systems, as in physics, chemist, economics, etc., if we have a differential system on a manifold of dimension, two of them having a first integral, then its phase portrait is completely determined. While the existence of first integrals for differential systems on manifolds of a dimension higher than two allows to reduce the dimension of the space in as many dimensions as independent first integrals we have. Hence, to know first integrals is important, but the following question appears: Given a differential system, how to know if it has a first integral? The symmetries of many differential systems force the existence of first integrals. This paper has two main objectives. First, we study how to compute first integrals for polynomial differential systems using the so-called Darboux theory of integrability. Furthermore, second, we show how to use the existence of first integrals for finding limit cycles in piecewise differential systems.