Secant Method: Step by Step — Formulas, Explanation, and a Practical Example

The secant method is a reliable way to approximate the root of an equation without using complicated derivatives, like in Newton’s method. The idea is simple: instead of using a tangent, we take a straight line that connects two points on the graph and find where it crosses the x-axis. Isn’t it convenient to move step by step toward the root while avoiding cumbersome calculations? This approach works well on an interval where the function is continuous and has only one root. Next, we’ll dive into the details and see how everything works in practice.

Secant Method: When to Choose — How to Apply

Let’s begin by exploring situations where this method excels. If computing the derivative is resource-intensive or simply inconvenient, the secant method allows you to work directly with function values. That’s already a plus, right? Another important condition is that the function on the interval [a,b] should be continuous, and the signs of f(a) and f(b) should be different. This guarantees at least one root inside the interval. By the way, it’s best if the root is unique; otherwise, the process may become unpredictable.

Graphical representation of the secant method

Now, let’s look at the geometry. We take points A(a,f(a)) and B(b,f(b)) and draw the secant (a chord) through them. The point where this line intersects the x-axis gives a new approximation of the root. After that, the interval “shrinks” asymmetrically: one endpoint stays fixed, while the other moves closer to the point where the function value is zero. Which endpoint should you fix? A good practical rule is: if, on the interval [a,b], the first and second derivatives maintain constant signs, fix the endpoint on the side that ensures monotone convergence. This reduces oscillations and makes the process more stable. Ultimately, you get an algorithm that, in many practical problems, converges quickly without excessive time costs.

From Secant to Root: Formulas and Stopping the Process

Now, let’s move on to the formulas. Consider the equation f(x)=0 on the interval [a,b], where f(a)*f(b)<0 and the root is unique. In the first step, we draw the secant through points A(a,f(a)) and B(b,f(b)). Since the equation of the secant is the equation of a line passing through two points, we have:

Equation of a secant line

To find the intersection point with the x-axis, we set y=0. Then, we get:

Secant method formula

This is the first approximation, obtained without derivatives—only from geometry. Convenient, right?

Graphical representation of the secant method for cases where f'(x)*f''(x)>0 and f'(x)*f''(x)<0

Next, if the value of x1 does not meet the accuracy requirements, we update the “moving” endpoint and repeat the construction. If it’s convenient to fix the right endpoint b (typically when f'(x) and f”(x) have the same signs on the interval, i.e., f'(x)⋅f”(x)>0; this corresponds to cases 1 and 2 in the diagram above), we build a new secant through points A1(x1,f(x1)) and B(b,f(b)) and find the second approximation:

Secant method formula

Following the same logic, we get the general recurrence formula for the case where the right endpoint is fixed:

Secant method formula

Alternatively, when it’s better to fix the left endpoint a (often this corresponds to the case where f'(x)⋅f”(x)<0; this applies to situations 3 and 4 in the diagram above), we use the formula:

Secant method formula

So, the choice of the “fixed” endpoint determines the form of the recurrence formula, and each step relies solely on the function values—which is why the method is computationally efficient.

The final question is about controlling the accuracy. Most often, the process is stopped based on the difference between successive approximations:

Secant method when to stop

where ε is the specified error. It’s also useful to track |f(xi+1)|: if the value is close to zero, the approximation is already close enough to the root. In the end, we have a controlled process: we gradually move toward the solution, and the chosen stopping criteria allow us to say, “That’s enough, the required accuracy has been reached”.

Practice Step by Step: Accuracy in Just a Few Iterations

Now that the basic ideas are clear, let’s look at a specific example. Theory is important, but it’s the practical application that shows the real effectiveness of the approach. We will solve a problem from start to finish and see how the secant method progressively approaches the root step by step.

Example 1: Find the solution to the nonlinear equation f(x)=x3+x-5=0 on the interval [0.5,2] with an accuracy of ε=0.01

Geometric interpretation of the secant method - iterations 1 - 2

First, let’s evaluate the signs of the first and second derivatives at the point x=0.5 and determine which formula to use:

Secant method example

Since both derivatives are positive, we fix the right endpoint b=2, and the initial approximation is x0=0.5.

Geometric interpretation of the secant method - iterations 3 - 5

Now, let’s move through the iterations. The first approximation:

Secant method example

The stopping condition is not yet met, so we proceed to the second iteration:

Secant method example

The accuracy is still not sufficient, so we continue:

Secant method example

At the fifth step, the criterion |x5-x4|<ε is met, so we accept x≈1.515 as the approximate root. As we can see, the secant method gives a result after just a few iterations—quickly, stably, and without needing derivatives.

After “Secant Method”: Where to Go Next

You’ve mastered the basics and now want to strengthen your toolkit? Great. There are three natural directions that logically follow this topic and will help you gain a deeper understanding of methods for solving nonlinear equations.

  1. Combined Secant and Tangent Method: Speed and Stability – This method combines the simplicity of calculations with the advantages of the tangent approach, often achieving results significantly faster, even in complex problems.
  2. Method of Simple Iteration: Step by Step to the Solution – This method builds a new approximation from the previous one using a constant scheme, making the process intuitive and predictable.
  3. Bisection Method: Guaranteed Convergence with Step Control – This method gradually narrows the interval, ensuring reliable progress towards the root and controlling accuracy at every step.

Final Stage: The Secant Method in Your Code

If you enjoy programming, try implementing the algorithm using the flowchart provided below. It sequentially shows the logic behind the secant method—from the initial approximation to obtaining the root. Isn’t it interesting to see how the idea from theory translates into real code and practically confirms the accuracy and reliability of the approach? This is a great way to combine your knowledge of mathematics with your development experience and ensure that the chosen strategy produces the expected results.

Flowchart of the algorithm for solving nonlinear equations using secant method