Suppose you want to determine the area bounded by two curves denoted by functions f(x) and g(x).
We find the points of intersection by setting f(x) = g(x). Then we determine which curve is the upper curve in the integral and which is the lower curve in the integral. Suppose the points of intersection are x=1 and x=3.
If f(x) is the upper curve then the integral looks like
Integral (1 to 3) [f(x) - g(x)] dx
If g(x) is the upper curve the the integral looks like
Integral (1 to 3) [g(x) - f(x)] dx