Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

wanted cubic

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).


share|cite|improve this question
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. – J. M. Apr 7 '11 at 5:15
up vote 2 down vote accepted

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.

share|cite|improve this answer
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.