# Finding the roots

1. Jan 1, 2005

### salemchic05

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.

2. Jan 1, 2005

### dextercioby

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

Daniel.

3. Jan 2, 2005

### tongos

newtons method

4. Jan 2, 2005

### mathwonk

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.

5. Jan 3, 2005

### Alex

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 $$y = (x^3 + 4(x^2) - 2)$$ 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:

or, in the case of $$y = (x^3 + 4(x^2) - 2)$$:

$$n = (x) - (x^3 + 4(x^2) - 2) / (3(x^2) + 8x))$$

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

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

return x;
}

cout<<x<<endl;
iterations++;
calculate(x);

return x;
}

int main()
{
cout<<"Pick a number: ";
int x;
cin>>x;
calculate(x);

return 0;
}

Last edited: Jan 3, 2005