---
title: "Secant algorithm, versus false position"
subject: "Numerical Method"
chapter: 2
key: "semester_4/numerical_method:secant-pseudocode-vs-false-position"
source: https://www.bctengineer.com/q/semester_4/numerical_method/secant-pseudocode-vs-false-position
site: BCT Engineering
---

# Secant algorithm, versus false position

Numerical Method · Chapter 2: Solutions of Nonlinear Equations

- Asked in: 2075 Baisakh, 4+2 marks
- Video: [Regula-Falsi vs. Secant Method](https://www.youtube.com/watch?v=TkHCvco05KY) — NPTEL-NOC IITM
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/numerical_method/secant-pseudocode-vs-false-position
- Whole chapter: https://www.bctengineer.com/md/semester_4/numerical_method/chapter-2

## Question

Write an algorithm of Secant method to calculate the roots of a nonlinear equation f(x) = 0. Write the differences between secant and false position methods.

## Short answer

Secant method: given x0,x1, compute x2 = x1 - f(x1)*(x1-x0)/(f(x1)-f(x0)), then shift. It does not need bracketing and uses the latest two points. False position requires f(a)f(b)<0, always brackes the root, guarantees convergence, but converges linearly; secant may diverge but has superlinear convergence (order ~1.618).

## Answer

Secant method finds a root of f(x) = 0 using x(n+1) = x(n) − f(x(n))·[x(n) − x(n−1)] / [f(x(n)) − f(x(n−1))].

#### Algorithm
```text
Algorithm: Secant method
Input : f(x), initial guesses x0, x1,
        tolerance e, maximum iterations N
Output: approximate root

1.  Read x0, x1, e, N
2.  Set i = 1
3.  Repeat steps 4 to 9 while i <= N
4.      f0 = f(x0),  f1 = f(x1)
5.      If |f1 - f0| is very small then
            print "Division by zero; change guesses"
            stop
6.      x2 = x1 - f1 * (x1 - x0) / (f1 - f0)
7.      If |x2 - x1| < e then
            print "Root =", x2, "after", i, "iterations"
            stop
8.      x0 = x1
        x1 = x2
9.      i = i + 1
10. Print "Method does not converge in N iterations"
11. Stop
```

#### Differences between Secant and False Position methods
| Point | Secant method | False Position method |
|---|---|---|
| Starting values | Any two values x0, x1 | Two values a, b with f(a)·f(b) < 0 |
| Root bracketing | Not kept; root may leave the interval | Always kept inside [a, b] |
| Choice of next points | Always the two latest points | One end is replaced so the sign change is kept |
| Convergence | Not guaranteed, may diverge | Always converges |
| Order of convergence | 1.618 (superlinear) | 1 (linear, often slower) |
| Sign test on f(c) | Not needed | Needed every iteration |

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which method need not keep the root bracketed?
   A. Secant
   B. False position
   C. Bisection
   D. None of them
   Answer: A. Secant always uses the two latest points. (Key point: Bracketing)

2. Convergence of false position is:
   A. May diverge, order 1.618
   B. Always converges, linear order
   C. Quadratic
   D. Never converges
   Answer: B. The bracket is retained, so it cannot diverge. (Key point: Convergence)

3. False position needs starting values a, b with:
   A. Any two values
   B. a = b
   C. f(a)*f(b) < 0
   D. f(a) = f(b)
   Answer: C. A sign change is required. (Key point: Starting values)

4. Secant method's formula is:
   A. x(n) - f(x(n))/f'(x(n))
   B. (x(n)+x(n-1))/2
   C. x(n) + f(x(n))
   D. x(n+1) = x(n) - f(x(n))[x(n)-x(n-1)]/[f(x(n))-f(x(n-1))]
   Answer: D. Slope of the line through the last two points replaces f'. (Key point: Secant formula)

## Related in Numerical Method

- [Secant method algorithm](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Asecant-method-algorithm) — Numerical Method, chapter 2, asked 2×
- [False position pseudo-code](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Afalse-position-pseudocode) — Numerical Method, chapter 2, asked 2×
- [False position: e^cos x - sin x - 1](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Afalse-position-ecosx) — Numerical Method, chapter 2
- [False position: cos x = x e^x](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Afalse-position-cosx-xex) — Numerical Method, chapter 2, asked 2×
- [Secant method: explain and derive](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Asecant-method-explain-derive) — Numerical Method, chapter 2, asked 3×
- [Secant: x e^x - cos x](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Asecant-x-exp-cosx) — Numerical Method, chapter 2, asked 3×

## Related in other subjects

- [Algorithm and flowchart: quadratic roots](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Aalgo-flowchart-quadratic) — Computer Programming, chapter 2
- [Quadratic equation roots in FORTRAN](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Afortran-quadratic-roots) — Computer Programming, chapter 11, asked 2×
- [Roots of quadratic equation in C](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Aquadratic-roots-c) — Computer Programming, chapter 5
- [Process versus thread differences](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Aprocess-vs-thread) — Embedded System, chapter 6, asked 4×
