# Find equation of cubic function with gradient?

I have to find a cubic function, when I know the gradient of that line at its start and finish.

The gradient at the start is 0.2, and at the top -0.4.

Using the cubic function: $f(x)=ax^3+bx^2+cx+d$ I need to model the section in between the red lines. Basically I assume I need to find $a,b,c,d$ and use the derivative of the cubic function with the gradients somehow (the gradients on the diagram are the gradients at the end of the red lines).

Thanks!

-
As an terminological aside: what you are trying to do here is to construct a cubic Hermite interpolant, since you have function and derivative values at two endpoints. –  Ｊ. Ｍ. Apr 7 '11 at 5:15
add comment

## 1 Answer

I am assuming you know the coordinates of your endpoints, although your diagram indicates nothing about the vertical dimension.

You have four unknowns to determine ($a, b, c, d$), so you want to get four equations in these unknowns. Two equations come from the fact that you know the coordinates of the endpoints. Two equations come from the fact that you know the derivatives at the endpoints. Thus, you have four equations in four unknowns, and then you must solve for these unknowns. These equations are linear in the four unknowns, so you can solve for them in the usual way.

-
Sorry, I've added coordinates! –  MathsStudent Apr 6 '11 at 23:33
@MathsStudent Well, then you are all set! Cheers. –  Matthew Conroy Apr 7 '11 at 1:00
I've got the 4 equations, but I can't figure it out from there. It's impossible to sub 3 of the equations into the fourth, as you just end up with a huge equation still with the 4 separate unknowns. What am I missing? How do I find the solution? –  MathsStudent Apr 7 '11 at 3:42
Never mind! I got it! Thanks so much! –  MathsStudent Apr 7 '11 at 4:56
add comment