# In this example, the mistake simply was, that trapz is defined as trapz(y, x), not as trapz(x, y).