0
$\begingroup$

Find one real and positive solution of equation $16x^2+3-9/x=0,x\neq 0$ using the cutting method with precision up to $\epsilon=0.01$.

I think that I am getting a mistake by using the secant method.

Let $f$ is continuous function such that $f(a)>0$ and $f(b)<0$. Then, $f(c)=0$ for some $c$ between $a$ and $b$. The secant method approximates the curve $$y=\frac{f(b)-f(a)}{b-a}(x-a)+f(a).$$

By setting $y=0,$ we get $$x=a-\frac{b-a}{f(b)-f(a)}f(a).$$

Here, we have $f(x)=16x^2+3-9/x.$ By setting $x_1=0.1,x_2=1,$ we get $f(x_1)<0,f(x_2)>0,$ so there exists one solution in an interval between $0.1$ and $1$. Line that pass through points $A(0.1,-86.84), B(1,10)$ is $y=107.6x-97.6.$ By setting $y=0,$ we get $x\approx 0.907063197.$ From here, we know that there is a solution between $0.1$ and $\approx 0.907063197.$ This is the first iteration of the secant method. We need to iterate this process until we get two consecutive values for $x$ that are $\epsilon=0.01$ apart.

Let's keep doing this process and I will show you where I get an error.

Second iteration

$$a=0.1,b\approx 0.907063197$$ We get $x\approx 0.852941518.$ $$|0.852941518-0.907063197|\approx 0.054121679\neq\epsilon$$

Third iteration

$$a=0.1,b\approx 0.852941518$$ We get $x\approx 0.819086901.$ $$|0.819086901-0.852941518|\approx 0.033854617\neq\epsilon$$

Fourth iteration

$$a=0.1,b\approx 0.819086901$$ We get $x\approx 0.812512316.$ $$|0.812512316-0.819086901|\approx 0.006574584\neq\epsilon$$

Fifth iteration

$$a=0.1,b\approx 0.812512316$$ We get $x\approx 0.806031284.$ $$|0.806031284-0.812512316|\approx 0.006481031\neq\epsilon$$

Sixth iteration

$$a=0.1,b\approx 0.806031284$$ We get $x\approx 0.799642054.$ $$|0.799642054-0.806031284|\approx 0.00638923\neq\epsilon$$

This process is too slow because in three last iterations we get $0.006...$ Could someone tell if this method is correct?

Quicker method is regula-falsi. Condition for applying this method on an interval $[0.7,1]$ is $f'(1)f''(1)>0,x_0=1,x_1=0.7$. Using the formula $$x_{n+1}=x_n-f(x_n)\frac{x_n-x_0}{f(x_n)-f(x_0)}$$ Here, we need two iterations.

$\endgroup$
1

2 Answers 2

3
$\begingroup$

The method you demonstrate is regula falsi, the bracketing method using the root of the secant.

Secant method

The secant method is not bracketing. It always shifts the base points as $a:=b$, $b:=x$. Thus in your second iteration you should have used $a=1.0$, $b=0.907063197$.

The secant method then converges in 3 steps to the required precision, even if it needs the 4th step to confirm that precision:

k       x[k]           f(x[k])         abs(x[k]-x[k-1])

0  0.1             -86.84
1  1.0              10.0                0.9
2  0.907063197026    6.24208714684      0.092936802974
3  0.752690372008    0.107576829042     0.154372825018
4  0.749983238407   -0.000670465203783  0.00270713360078
5  0.750000005929    2.37172397277e-07  1.6767521941e-05

Remarks on Regula falsi

Regula falsi has the problem, as you saw, that in quite many cases the change is restricted to one side of the interval. In this stalling situation the convergence reduces to a slow, sometimes very slow, linear convergence (see https://math.stackexchange.com/a/2100092/115115). There are anti-stalling variants that restore super-linear convergence, see wikipedia (better in the german wp), the Illinois variant is especially easy to implement.

In your last variant of the method you introduce stalling by design, which will most likely lead to a slow linear convergence.

$\endgroup$
0
$\begingroup$

The result of your question is $3/4$, see this link

The secant method's convergence is slower than that of Newton's method (the second method you have). Here is the passage from Wiki:

Difficulty in calculating derivative of a function with Newton's method:

Newton's method requires that the derivative be calculated directly. An analytical expression for the derivative may not be easily obtainable and could be expensive to evaluate. In these situations, it may be appropriate to approximate the derivative by using the slope of a line through two nearby points on the function. Using this approximation would result in something like the secant method whose convergence is slower than that of Newton's method.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .