Finding zero of function which is a real number

90 Views Asked by At

Is there an easier way of finding or approximating the x-axis-intersect of this function:

$$ 0=x^3-3x^2+x+3 $$

The approximate solution is:

$$ x=-0.76929 $$

and the precise solution is:

$$ x=1 - \frac{\sqrt[3]{9-\sqrt{57}}}{3^{2/3}}-\frac{2}{\sqrt[3]{3-(9-\sqrt{57}}} $$

I am asking because reaching the real solution can be done computationally or doing an impossible amount of steps. Is the best approximation to plot the graph by hand and just guessing where the x-intersect has to lie?

2

There are 2 best solutions below

0
On

This is an interesting question as the closed formula is rather difficult to beat, just a handful of transcendent function calls, easily handled by modern processors.

If you are after an approximate but fast solution, the real bottleneck is not root computation but root separation, i.e. finding intervals that contain exactly one root and thus show a change of sign. From there, inverse linear interpolation can be just enough.

The traditional belief that Newton's method is the one to be used for such cases is wrong: it is a local root finder, excellent when you have a fair approximation of the root, but of no use as a global root finder. When starting from a poor approximation it can be slow, and what's worse, it gives no clue where to start.

In the case of the third degree equation, a complete discussion is possible as the number of root is 1 or 3, depending on the existence and sign of the extrema, found from the solution of a second degree equation.

This can be combined with formulas for bounding the roots: http://en.wikipedia.org/wiki/Properties_of_polynomial_roots#Polynomials_with_real_roots.

Starting from a general third degree equation $ax^3+bx^2+cx+d=0$, it is advantageous to transform it in the canonical form $x^3+px+q=0$ (normalizing by $a$ and translating by $-\frac b{3a}$).

Then, in case of three real roots, Samuelson's inequality brackets the roots inside

$$x_{1\pm}=\pm2\sqrt\frac{-p}3,$$ and the extrema themselves are at $$x_{0\pm}=\pm\sqrt\frac{-p}3.$$ So when $p$ is negative, compute the polynomial value at the four points $x_{1-}, x_{0-}, x_{0+}, x_{1+}$ and detect the changes of sign. This will give you 1 or 3 starting intervals.

3
On

I think that the problem starts to be easy if you checked that there is only one real root (which is your case). So, let us consider the function $$f(x)=x^3-3x^2+x+3$$ which is an incresing function since it is a polynomial of odd degree. You can easily see that $f(0)=3$ and so the solution is such that the solution looked for (say $x_{sol}$) is negative. Similarly $f(-1)=-2$; so, $-1 < x_{sol} < 0$ and we want a good and quick approximate solution.

For solving equation such as $f(x)=0$, Newton method is very simple : starting from a guess $x_0$, the iterates are given by $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$$ If we start the iteration, say at the middle of the interval, that is to say $x_0=-0.5$, the successive iterates are $-0.842105$, $-0.772827$, $-0.769301$, $-0.769292$ which is the solution for six significant figures.

You can notice that we obtained very quickly the level of accuracy you were asking for.