I have a sequence of a samples coming from sampled and processed periodic signals. I need to approximate the integral of these signals.
Using scipy.integrate.cumtrapz which applies the composite trapezoidal rule I obtained the integrated samples, but I have a problem. One of these integrated functions become a decreasing function, and I have no idea of what is going on... This is the simply code I used:
test_set_y_int = integrate.cumtrapz(test_set_y)
y_int = integrate.cumtrapz(y)
The plot of the initial signals, the blue one is test_set_y, the red one is y :

The plot of the integrated signals, the blue one is test_set_y_int, the red one is y_int. 
Any suggestions about what is happening and what should I do?
That's not surprising, as a simpler example may show more clearly: $f(x)=1+\cos x$ is periodic, and $\int^x_0f(x)\,dx=x+\sin x$ is increasing.