you'll drive yourself nuts trying to parameterize all these function bits so just use geometry.

The integral (antiderivative) is the area under the curve... plus a constant. In this case they've given you indirectly what the constant must be.

Just use geometry to figure out the various areas involved and add that constant.