If we assume it is the x-axis that forms the tangents at x = -5 and x = 2, then we can do the following:

The y-intercept is just the value we chose for g.
It would be tedious to solve the four simultaneous equations for a, b, c and d by hand though!
.