The function of the black line must come from your own work. I don't know anything about your particular application 
If the black line is something that exists as data, you can supply vectors of x and y values to trapz.
If the black line is something that exists as a formula, you can define a range of x values and use the formula to calculate a y value for each one, and supply these to trapz.