1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Finding Cubic Functions

  1. Dec 12, 2012 #1
    1. The problem statement, all variables and given/known data

    I have a line of a cubic function that passes through (-10,4), (-2,3), (-1,2), (0,1), (7,0). I must find the function of this line.

    2. Relevant equations

    3. The attempt at a solution
    I know you cant see this but the line has a "S" curve to it. Making me assume that it is a cubic funtion.
  2. jcsd
  3. Dec 12, 2012 #2


    Staff: Mentor

    have you tried graphing it?
  4. Dec 12, 2012 #3
    I need to find the function, using those points, thats all that is given.
  5. Dec 13, 2012 #4


    Staff: Mentor

    I don't have an idea of how to solve it but if you look at just the y values what do you see?

    Are you sure you aren't simply to find the line that best fits the points?
  6. Dec 13, 2012 #5


    Staff: Mentor

    try starting with an equation of the form ax^4 + bx^3 + c^x2 + dx +e = y and generate a set of 5 equations in five unknowns using the the five points one by one.

    So start with (0,1) and you get simply e=1 now proceed to find the other constants.
  7. Dec 13, 2012 #6


    User Avatar
    Science Advisor

    Notice that jedishrfu has a fourth degree polynomial, not a cubic. That is because a cubic, [itex]y= ax^3+ bx^2+ cx+ d[/itex] has four coefficients which take four equations to determine. So there exist a unique cubic through any four given points. You give five points so there may not be such as cubic. Of course, if those points do lie on a cubic, you will find that the coefficient of [itex]x^4[/itex] is 0.

    Another way to find the polynomial (though I really prefer jedishrfu's method) is the "Lagrange polynomial":
    [tex]y(x)= 4\frac{(x+2)(x+1)(x)(x- 7)}{(-10+ 2)(-10+ 1)(-10)(-10- 7)}+ 3\frac{(x- 4)(x+ 1)(x)(x- 7)}{(-2+ 10)(-2+ 1)(-2)(-2- 7)}[/tex]
    [tex]+ 2\frac{(x+ 10)(x+ 2)(x)(x- 7)}{(-1+ 10)(-1+2)(-1)(-1-7)}+ 1\frac{(x+10)(x+2)(x+1)(x- 7)}{(0+10)(0+2)(0+1)(0-7)}+ 0\frac{(x+10)(x+2)(x+1)(x)}{(7+10)(7+2)(7+1)(7- 0)}[/tex]

    Do you see the idea? Each fraction has factors in the numerator of "x- " each x value except one. And the denominator has factors with that missing x value minus each of the other x values. If x is any one of the given x values, every fraction except one will be 0 and then the fraction will be 1 so that we just have y value that was in front. And, of course, because there were five points, each fraction has 4 factors involving x and so this will, in general, be a fourth degree polynomial.
    Last edited by a moderator: Dec 13, 2012
  8. Dec 14, 2012 #7


    User Avatar
    Homework Helper
    Education Advisor
    Gold Member

    Ignoring the point, (0,1), the 4 x 5 matrix can be made:
    [-1000, 100, -10, 1, 4]
    [-8, 4, -2, 1, 3]
    [-1, 1, -1, 1, 2]
    [343, 49, 7, 1, 0]

    Using the online software www.math.purdue.edu/~dvb/matrix.html, the reduced row form is:
    1, 0, 0, 0, 0.0106
    0, 1, 0, 0, 0.0408
    0, 0, 1, 0, -.9518
    0, 0, 0, 1, 1.018

    The apparent coefficients give an equation that can be run through google and graphed. The result is interesting. Just type in, "graph 0.0106x^3+0.0408x^2-0.9518x+1.018" and see the resulting graph. As you inspect the points, you see a near, not perfect, fit to the five original given points and there are three roots. They are nearly x=-12, x=1, and x=7. My efforts this way may have a mistake somewhere since those roots as binomial factors do not give the same or similar coefficient for the cubic term. Maybe this is off only by a constant value factor?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook