First of all, we compute the points of interest, i.e. the points where the curve cuts the x axis: since the expression is already factored, we have
Which means that the roots are
Next, we can expand the function definition:
In this form, it is much easier to compute the derivative:
If we evaluate the derivative in the points of interest, we have
This means that we are looking for the equations of three lines, of which we know a point and the slope. The equation
is what we need. The three lines are:
This is the tangent at x = -2
This is the tangent at x = 0
This is the tangent at x = 1