Added a function myintegral2 that makes use of sum