Divergence of the secant method

numerical methods

Those ten iterations are obtained using the secant method for the function $\tan(x\pi)-6$ starting with an interval of $[0\,\,\,0.48].$

enter image description here
The actual root is about $0.447431543$.

Can you explain why the method exhibited poor performance?

Best Answer

This Desmos demo might help you see what's going on. The image of the plot is also below, the green and red dots are the initial interval. It has the first four secant lines plotted, but you can probably follow the pattern/add more if you want. Essentially the iterates are jumping around between different pieces of your function. Because your function has so many vertical asymptotes you're going to need your initial interval to be closer to the root if you want any hope of the method converging.

enter image description here

Related Question