Hello, I am having trouble with a calculus problem which requires us to evaluate this sum of two integrals:

In the answer key the next step is written as:

However, I don't understand why the third term in the first integral is being subtracted, and why the denominator in the second integral is negative. If it helps, the original problem was to find the area of the region bounded by

and

by integrating with respect to x. I set up the integral properly but I don't understand why it is being evaluted like this.