Finding root of nonlinear equation in interval

76 Views Asked by At

I'm trying to understand finding root questions and I do not quite understand how you should approach them. I've searched online and I've come across posts suggesting to use substitution where you take the values within the specified interval and plug them in and the answer you get, you should plug back in and see if the equation is $0$, if so, you have a root. Also came across a technique called graphical analysis which I could not find much on but I assume its similar in that you plug in values from the interval and the answers you get you plot and eyeball the where the $x$ intersection and consider it a root? I'm not sure if this is correct or how you should approach this and would appreciate any insight insight into how I should. I'm not strong in math and I am usually bullied away by my teachers ego when asking for help so I thought I'd ask the maths community so I can learn something. Thanks in advance.

Interval $[-4,1]$ $$f(x)=\sin(x)+x^{3}+2x^{2}+1 = 0$$

2

There are 2 best solutions below

0
On

Graphing or using inspection, you probably notice that the solution is very close to $x_0=-2$.

So, in the same spirit as Newton, let $x=-2-t$ and expand the sine to obtain $$-t^3-4 t^2-4 t+1-\cos (2) \sin (t)-\sin (2) \cos (t)=0$$ Use the well known Taylor series or approximants $$0=(1-\sin (2))- (4+\cos (2))\,t+O\left(t^2\right)$$ So, a very first approximation is $$t=\frac{1-\sin (2)}{4+\cos (2)}=0.0253\quad \implies \quad x=-2.0253$$ while the exact solution is $-2.0247$.

If you want to improve, add the next term of the series; it is $$- \left(\frac{4-\sin (2)}{2}\right)\, t^2$$ and solve the quadratic equation (retaining the closest root) $$t=\frac{4+\cos (2)-\sqrt{33+\sin ^2(2)-18 \sin (2)+8 \cos (2)}}{\sin (2)-8}=0.0247$$ which gives the solution for four exact decimal places.

0
On

The function here itself is nothing of interest, its only relevant property is that it does not have any roots that are easy to guess, you have to work for it.

The fundamental point of departure for numerical root-finding methods is that "in the real world", evaluation of $f(x)$ is expensive, so expensive that a hand full of arithmetic operations and comparisons have a negligible weight. Without this restriction you could, as you proposed, proceed with graphing the function, find close points with opposite signs in their values and zoom in, graphing this new interval etc.

But now imagine you have to wait 10 seconds for each function value, and how many function values are evaluated to get a nice graph.

So you start with two points and only their function values, where additionally the values have opposite sign, guaranteeing a root between them by the intermediate value theorem. Then the general idea is to select some point in-between, evaluate its function value and discard the previous point with the same sign. Thus you have at each step an interval bracketing at least one root. Popular choices are the midpoint of the interval or the root of the secant line through the known points and values. This gives you the bisection method and regula falsi or false-position method and their variants.

Or you keep a larger collection of points, among them a pair with opposing signs in their values for the bracketing interval and some others that have small function values. Then from the points with small values you can guess the local shape of the function and take the root of that guess. Roots of secant lines and midpoints are also still available. Now you get to select which of these candidates that are inside the bracketing interval promises the smallest function value, that is, is closest to the root, or substantially shrinks the length of the bracketing interval. To keep the size of the collection, the point with the largest value gets discarded (but keeping the new bracketing interval intact). Methods with that philosophy are named after their inventors Dekker, Muller, Brent.

If you have not only the function values, but also the derivatives available, you get still more possibilities to guess the local shape of the function and get better candidates for the root. But, to remain with above penalty, if evaluation of a function value costs 10 sec, then usually the evaluation of the derivative costs 20 sec, so one has to be frugal with it.