---
title: "Secant: cos x + e^x - 5"
subject: "Numerical Method"
chapter: 2
key: "semester_4/numerical_method:secant-cosx-exp"
source: https://www.bctengineer.com/q/semester_4/numerical_method/secant-cosx-exp
site: BCT Engineering
---

# Secant: cos x + e^x - 5

Numerical Method · Chapter 2: Solutions of Nonlinear Equations

- Asked in: 2073 Magh, 6 marks
- Video: [Secand method in 5 minutes | solution of algebraic equation](https://www.youtube.com/watch?v=6S2SOhWZ0bU) — Smart Engineer
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/numerical_method/secant-cosx-exp
- Whole chapter: https://www.bctengineer.com/md/semester_4/numerical_method/chapter-2

## Question

Find a real root of cos x + e^x - 5 = 0 accurate to 4 decimal places using the Secant Method.

## Short answer

Using x0=1, x1=2, the secant iteration x2=x1 - f(x1)*(x1-x0)/(f(x1)-f(x0)) yields root 1.6190 after 5 iterations to four decimals.

## Answer

**Secant formula:** x(n+1) = x(n) − f(x(n))·[x(n) − x(n−1)] / [f(x(n)) − f(x(n−1))].

#### Step 1: Starting values
f(x) = cos x + eˣ − 5
f(1) = 0.5403 + 2.7183 − 5 = −1.7414 < 0 and f(2) = −0.4161 + 7.3891 − 5 = 1.9729 > 0, so a root lies in (1, 2).
Take x0 = 1 and x1 = 2.

#### Step 2: Iterations
| n | x(n-1) | x(n) | f(x(n-1)) | f(x(n)) | x(n+1) |
|---|---|---|---|---|---|
| 1 | 1.0000 | 2.0000 | -1.7414 | 1.9729 | 1.4688 |
| 2 | 2.0000 | 1.4688 | 1.9729 | -0.5540 | 1.5853 |
| 3 | 1.4688 | 1.5853 | -0.5540 | -0.1338 | 1.6224 |
| 4 | 1.5853 | 1.6224 | -0.1338 | 0.0135 | 1.6190 |
| 5 | 1.6224 | 1.6190 | 0.0135 | -0.0003 | 1.6190 |
| 6 | 1.6190 | 1.6190 | -0.0003 | -0.0000 | 1.6190 |

The last two iterates agree to four decimals.

**Answer: root ≈ 1.6190**

## Check yourself

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

1. Starting values 1 and 2 are chosen because:
   A. f(1) < 0 and f(2) > 0
   B. f(1) = f(2)
   C. Both are roots
   D. f(1) > 0
   Answer: A. The sign change shows a root in (1, 2). (Key point: Starting values)

2. The first step uses:
   A. x2 = x1 - f1/f'(x1)
   B. x2 = x1 - f1(x1 - x0)/(f1 - f0)
   C. x2 = (x0+x1)/2
   D. x2 = x0 + f0
   Answer: B. That is the secant formula. (Key point: Formula)

3. The root is:
   A. 1.4688
   B. 2.0000
   C. 1.6190
   D. 1.5853
   Answer: C. The last iterates agree at 1.6190. (Key point: Result)

4. The iteration stops when:
   A. f(x) is negative
   B. x reaches 2
   C. Three steps are done
   D. Last two iterates agree to four decimals
   Answer: D. Successive values within tolerance. (Key point: Stopping)

## Related in Numerical Method

- [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×
- [Secant: x^5 - 3x^3 - 1](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Asecant-x5-3x3-1) — 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 method algorithm](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Asecant-method-algorithm) — Numerical Method, chapter 2, asked 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×
- [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
