enter image description here
I\'ve coded a trapezoidal function, but I\'m having trouble coding a function to solve it