False Position Method

340 Views Asked by At

Is it possible to use False position method to find the root near $\pi/2$ for this function?

$$f(x)=\frac12+\frac{x^2}4-x\sin(x)-\frac{\cos(2x)}2$$

As you can see, she is positive so we will never get $f(a) \times f(b)<0$

Graphic

1

There are 1 best solutions below

3
On

It is possible to use a modification of false position for finding minimums of functions to find the root (if it is indeed one).

The idea is that three points $x_\mathrm L<x_\mathrm M<x_\mathrm R$ are given so that $f(x_\mathrm M)<f(x_\mathrm{L~and~R})$.

We then generate a new point $x_\mathrm N$ by applying false position to the points $(x_\mathrm L,\pm f(x_\mathrm L))$ and $(x_\mathrm R,\mp f(x_\mathrm R))$, which will effectively flip the sign of the function on one side of the root.

We then update $(x_\mathrm L,x_\mathrm M,x_\mathrm R)$ so that $f(x_\mathrm M)$ is minimal (between $f(x_\mathrm M)$ and $f(x_\mathrm N)$) and $x_\mathrm L$ and $x_\mathrm R$ are the nearest points found on the left and right sides of $x_\mathrm M$.

See this graph for a visualization of the process. (There is a slight mistake in the conditions for updating, but the first 3 iterations are still correct.)

See here for code.


Update:

I had forgotten that there is a way to get false position to find even order roots. The trick is to force a sign change onto one endpoint and start the other point close to the root but on the opposite side. The convergence of this is extremely slow, however, so I would not recommend doing so.