Consider the area between the graphs and

I know how to do this problem by doing it as a sum of two integrals but what I am stuck on putting it together as one function

Alternatively this area can be computed as a single integral

where ,

How do I go about doing this? Thanks