I am running simulations, and the output will be a line y = mx+b. I am interested in the area below the line between x=0 and x=1. I am only interested in the area that is below the diagonal y = x.
I have figured out how to determine this area by finding areas of triangles. But to do so, I have to define 6 cases. This requires many if-else statements in my computer program, and is inefficient.
I was wondering if there is an elegant solution to this problem which will not require such a complex program?
In the diagram below, the diagonal line is solid, my line of interest is the dotted line.