Implemented the integrate function.
Implemented the integrate function in particle.cpp