By "slope" I assume you mean slope of the tangent line to the parabola.
For any given value of <em>x</em>, the slope of the tangent to the parabola is equal to the derivative of <em>y</em> :

The slope at <em>x</em> = 1 is 5:

The slope at <em>x</em> = -1 is -11:

We can already solve for <em>a</em> and <em>b</em> :


Finally, the parabola passes through the point (2, 18); that is, the quadratic takes on a value of 18 when <em>x</em> = 2:

So the parabola has equation
