Newton-Raphson Method - need help understanding an example I am currently trying to finish an assignment regarding Newton-Raphson method. Anyone able to explain an example to me? The function $f(x) = \sin(x) + \sin(\frac{10x}{3})$ is shown on the picture. The red dot is the starting point and the cross is a local extrema found by using the NR method. My question is why isn't the cross on the local extremas near the starting point, specifically where $x \approx 1.5$ and $x \approx 0.5$ which is visible on the picture. Why did the point end up where it did and passed two extremas on its way? Could this be an implementation issue, or is this how it's supposed to be ?

 A: Newton-Raphson gives no guarantee to converge to the root nearest to the starting point. It just converges to some root, when it does.
When you are far from a root, the linear approximation on which the method is based does not hold and the iterations can wander randomly.
Anyway, the results that you show do not seem to match this situation.

On this complex plot, you see your curve in blue, and the first derivative in green. Then the magenta curve is the first NR iterate, starting from the initial approximation $x$, and the black curve is the second approximation.

You can see various plateaus corresponding to the extrema of the blue curve (roots of  the green one), and partially drawn asymptotic curves in between, corresponding to erratic behavior.
A: Giving $f(x)$ it's stationary points are found where $f'(x) = g(x) = 0$. The Newton's method is a fixed point method such as
$$
x_{k+1} = \phi(x_k)
$$
with
$$
\phi(x) = x - \frac{g(x)}{g'(x)}
$$
where
$$
g(x) = \cos (x)+\frac{10}{3} \cos \left(\frac{10 x}{3}\right)
$$
Now a fixed point method has some sufficient convergence conditions that can be extracted from
$$
x_{k+1}-x_k = \phi(x_k) - \phi(k_{k-1}) = \phi'(\zeta)(x_k-x_{k-1}),\ \ \ \zeta \in (x_k, x_{k-1})
$$
so if $|\phi'(\zeta)| < 1$ we have convergence
Follows a plot showing in red $g(x)$ and in blue $\phi'(x)$

so choosing initial conditions such as $x_0\in [0.3, 0.7]$ the convergence is to $0.548883$ and if $x_0\in [1.2, 1.6]$ converges to $1.39826$. Out of those intervals, the convergence to the next stationary point is uncertain.
A: Wolfram Alpha agrees with your picture.
So indeeed when running Newton's method, you get approximately 1.346, the closest root, not like you were obtaining.
However, even if you would not get the closest extremum, the reason for that phenomenon would be that Newton's method gives no guarantees to which specific local extremum it will converge to.
A: If I poperly understood, you are looking for the minimum of
$$f(x)= \sin(x) + \sin(\frac{10}{3}x)$$ starting with $x_0=1$.
This means that you are looking for the zero of function
$$g(x)=f'(x)=\cos (x)+\frac{10}{3} \cos \left(\frac{10 }{3}x\right)$$ which, repeating your calculations gives the following iterates
$$\left(
\begin{array}{cc}
 0 & 1.00000 \\
 1 & 3.14110 \\
 2 & 3.41900 \\
 3 & 3.38666 \\
 4 & 3.38725 
\end{array}
\right)$$
The problem is that
$$g''(x)=-\cos (x)-\frac{1000}{27} \cos \left(\frac{10 }{3}x\right)$$
At the starting point we have
$$g(1)=\cos (1)+\frac{10}{3} \cos \left(\frac{10}{3}\right)\approx -2.73194 $$
$$g''(1)=-\cos (1)-\frac{1000}{27} \cos \left(\frac{10}{3}\right)\approx 35.818$$ that is to say $g(1)\times g''(1) <0$.
By Darboux theorem, because of this result, you will have an overshoot of the solution.
