Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Finding the roots

  1. Jan 1, 2005 #1
    We have to find the max/min of a derivative and we can't figure out how to find the roots of the function. The equation is y'=-5x^4-7x^2+10x+4. We tried factoring, but that won't work, the quadratic equation doesn't work, and we don't know how to solve for x. :cry:
  2. jcsd
  3. Jan 1, 2005 #2


    User Avatar
    Science Advisor
    Homework Helper

    Check post number 15 from here
    It's a link to the wepage from wolfram for quartic equations.

  4. Jan 2, 2005 #3
    newtons method
  5. Jan 2, 2005 #4


    User Avatar
    Science Advisor
    Homework Helper

    who gave you this problem? are you sure there isn't some mistake? it is not feasible to assign a problem like this in a class setting, unhless approximations are allowed.

    of course if it is a real life problem, then approximations are alloed and newton's method is useful, or just easy intermediate value methods, like plugging in values and seeing whether they are positive or negative.

    e.g. -5x^4-7x^2+10x+4 comes out 4 when x = 0, and comes out 2 when x = 1, but comes out maybe -84 when x = 2. so there is a root somewhere between 1 and 2, and probably closer to 1 than to 2. in a few minutes with a calculator you can get it this way to within a decimal place or two. that is much easier and more practical than the quartic formula, which is just a theoretical curiosity "imho" as they say here.
  6. Jan 3, 2005 #5
    Use newtons methed - it saves a lot of time (assuming your teacher doesn't mind approximations).

    It's a simple recursive function so it can be implemented as a TI-BASIC program quite easily. Say you had a function [tex]y = (x^3 + 4(x^2) - 2)[/tex] and you couldn't use the quadratic equation on it for whatever reason. Simply graph the function and approximate at which x-value y crosses the x-axis (zero). Now use this formula:

    n = (x) - ("your function"/"derivative of your function")
    or, in the case of [tex]y = (x^3 + 4(x^2) - 2)[/tex]:

    [tex]n = (x) - (x^3 + 4(x^2) - 2) / (3(x^2) + 8x))[/tex]

    where x is the number that you approximated the zero to be, and n is the actual zero. Depending on how close you guessed the zero to be, you might have to use the equation over and over again until you're obviously approaching some definate number.

    A while ago I wrote a program that approximates the zero of a function (the closest zero to the number you guessed, anyway). I also have a TI-BASIC version, but i can't copy and paste that so you're SOL. This should be easy enough to understand anyhow:

    Code (Text):
    #include <iostream>

    using namespace std;

    //program recursively solves the zero of a function using the newton method.

    int iterations = 0;  //keeps track of how many iterations we have gone through to find where f crosses the x-axis

    long double calculate(long double x)
        long double test=0;  //used to test if we have hit one number
        test = x;
        //for example function (y = x^2 - 4x)
        x = ((x) - (((x*x*x)+(4*(x*x))-2)/((3*(x*x))+(8*x))));

            cout<<"The function crosses the x-axis at x = "<<test<<endl;
            cout<<"It took "<<iterations<<" steps to find this answer."<<endl;

            return x;


        return x;

    int main()
    cout<<"Pick a number: ";
    int x;

    return 0;
    Last edited: Jan 3, 2005
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook