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 ?


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.