How to implement integration in objective function of a model

Dear all
I am trying to minimize area between two curves using numerical integration by trapezoidal rule. The integral bounds are also variables in my model, i.e. int(f(x),[a , b]) wherein a and b are variables representing integral bounds.
Any idea for formulation of the model is appreciated.

Thanks in advance;
Best regards;