Implementing something like tt.trapz() for numerical integration over a set domain?

We have some post using numerical integration: Custom theano Op to do numerical integration you can take a look at try the theanoOps from that post.