Consider the attached figure (note that the axis are not in a 1:1 scale).
We want the (finite) area between the two parabolas, where
is the green one, and
is the red one.
We need the following result: given a function f, the integral

returns the area between the function and the x axis.
So, if we subtract the area below the green function between points A and B from the area below the red function between points A and B, we have exactly the area between the two. So, we need the x coordinates of points A and B.
Since they are the points of interception between the two parabolas, we can compute them by solving the equation

So, we need

The primitive of this function is

And we need to compute it at the two endpoints: the area is given by
