def trapez_area(sefl, y, dx): """ Calculate the area under a curve using the composite trapezoidal rule. """ return trapz(y, dx=dx)