How to Tell if There Are Multiple Solutions in Newton-Raphson?

587 Views Asked by At

So if we have $$f(x) = x\cos x = 5$$ then one value of $x$ to this is roughly 5.7628 using Newton-Raphson.

But this isn't the only solution, which you can see by looking at a graph of $x\cos x.$

My question: is there a way to tell there are many solutions without knowing the graph of $x\cos x$? E.g. does the derivative tell us anything?

Thanks!

3

There are 3 best solutions below

0
On

Having multiple solutions is as much a property of the function itself as it is a property of what Newton's method would give you. In general, it's not always simple to tell how many roots a function has. For polynomials and rational functions, there's the Fundamental Theorem of Algebra, which says that an $n$-degree polynomial has exactly $n$ roots (including repeated ones). And for functions with known asymptotes, like $f(x)\to x^3$, you can get more of a bearing. But for periodic functions, it can be more difficult, especially if they have sums. As an example, how many roots do these two functions have? $$2+\cos x+\cos\left(4x\right) \\ 2+\cos x+\cos\left(\color{red}{5}x\right) $$

The first one has zero but the second has infinitely many which is a bit of a big difference. Products are easier to work with since $f(x)g(x)$ will have the same roots as $f(x)$ and $g(x)$. So your function has the same roots as $x$ (a $1$-degree polynomial) and $\cos x$ (which you should know by heart).

Derivatives can sometimes you but aren't always useful, particularly since differentiation removes constant terms. The functions $\sin x$ and $\sin x + 2$ have the same derivative but very different roots.

0
On

Somewhat more generally, consider an equation of the form $g(x) h(x) = c$, where $|g(x)| \to \infty$ as $x \to +\infty$, while $h(x)$ is periodic and takes both positive and negative values, and both $g$ and $h$ are continuous. Then $g(x) h(x)$ takes arbitrarily large positive and negative values on $[0, \infty)$, and by the Intermediate Value Theorem your equation has infinitely many solutions there.

0
On

You are looking to the zero's of function $$f(x)=x\cos(x)-5\tag 1$$ for which $$f'(x)=\cos(x)-x\sin(x)\tag 2$$ So, there are maxima and minima everytime that $f'(x)=0$.

The solutions of this last equation can be very well approximated developing $(2)$ as a Taylor series built around $x=n \pi$ and using later series reversion. This gives $$x_n=q+\frac{1}{q}-\frac{4}{3 q^3}+\frac{53}{15 q^5}-\frac{1226}{105 q^7}+\frac{13597}{315 q^9}-\frac{65782}{385 q^{11}}+O\left(\frac{1}{q^{13}}\right)\tag 3$$ where $\color{red}{q=n \pi}$.

So, as soon as $f(x_n) >0$ equation $(1)$ will have a solution between $x_n$ and $x_{n+1}$ and then a good starting point for Newton method would be $x_0=\frac 12(x_n+x_{n+1})$.

For the first root you already computed, Newton iterates would be $$\left( \begin{array}{cc} n & x_n \\ 0 & 4.93137306027 \\ 1 & 5.71229939308 \\ 2 & 5.76156909745 \\ 3 & 5.76280863269 \\ 4 & 5.76280945609 \end{array} \right)$$ Let us try for the fifth solution of $(1)$. Newton iterates would be $$\left( \begin{array}{cc} n & x_n \\ 0 & 17.3368474158 \\ 1 & 17.5668131139 \\ 2 & 17.5673681327 \\ 3 & 17.5673681604 \end{array} \right)$$