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

# Secant: x e^x - cos x

Numerical Method · Chapter 2: Solutions of Nonlinear Equations

- Asked in: 2069 Poush, 8 marks
- Video: [Find the root of equation cosx - xe^x = 0 using Secant method || Numerical method example](https://www.youtube.com/watch?v=NxvTxAL6zFU) — IT SAFAL
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/numerical_method/secant-x-exp-cosx
- Whole chapter: https://www.bctengineer.com/md/semester_4/numerical_method/chapter-2

## Question

Find the root of the equation x e^x - cos x = 0 using the secant method correct to four decimal places.

## Short answer

Use secant method with x0=0, x1=1 on f(x)=x e^x - cos x. Iterates converge to 0.5178, so the root is approximately 0.5178.

## 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) = x·eˣ − cos x
f(0) = −1 < 0 and f(1) = 2.7183 − 0.5403 = 2.1780 > 0, so a root lies in (0, 1).
Take x0 = 0 and x1 = 1.

#### Step 2: Iterations
| n | x(n-1) | x(n) | f(x(n-1)) | f(x(n)) | x(n+1) |
|---|---|---|---|---|---|
| 1 | 0.0000 | 1.0000 | -1.0000 | 2.1780 | 0.3147 |
| 2 | 1.0000 | 0.3147 | 2.1780 | -0.5199 | 0.4467 |
| 3 | 0.3147 | 0.4467 | -0.5199 | -0.2035 | 0.5317 |
| 4 | 0.4467 | 0.5317 | -0.2035 | 0.0429 | 0.5169 |
| 5 | 0.5317 | 0.5169 | 0.0429 | -0.0026 | 0.5177 |
| 6 | 0.5169 | 0.5177 | -0.0026 | -0.0000 | 0.5178 |
| 7 | 0.5177 | 0.5178 | -0.0000 | 0.0000 | 0.5178 |

The last two iterates agree to four decimals (both are 0.517757).

**Answer: root ≈ 0.5178**

## Check yourself

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

1. f(x) for x e^x - cos x is zero between:
   A. 0 and 1, f(0) = -1, f(1) = 2.178
   B. 1 and 2
   C. -1 and 0
   D. 2 and 3
   Answer: A. Sign change from - to +. (Key point: Function)

2. Starting values are:
   A. 0.5 only
   B. x0 = 0, x1 = 1
   C. 1, 2
   D. 0, 0
   Answer: B. Taken from bracket ends. (Key point: Start)

3. The secant formula uses:
   A. The derivative
   B. The midpoint
   C. The last two iterates and their function values
   D. Only the last value
   Answer: C. No derivative needed. (Key point: Step)

4. The root is:
   A. 0.5317
   B. 0.5169
   C. 0.3147
   D. 0.5178
   Answer: D. Last two iterates agree at 0.5178. (Key point: Result)

## Close variants set in other exams

- [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: 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×

## Related in Numerical Method

- [Secant: cos x + e^x - 5](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Asecant-cosx-exp) — Numerical Method, chapter 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: e^cos x - sin x - 1](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Afalse-position-ecosx) — Numerical Method, chapter 2
- [Secant algorithm, versus false position](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Asecant-pseudocode-vs-false-position) — Numerical Method, chapter 2
- [N-R: sin x = e^-x with limitations](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Anewton-raphson-sinx-exp) — Numerical Method, chapter 2

## Related in other subjects

- [Pedal equation of r^m = a^m cos mθ](https://www.bctengineer.com/question.md?key=semester_1%2Fmathematics_i%3Apedal-equation-rm-cos-m-theta) — Mathematics I, chapter 1, asked 2×
- [Bernoulli's equation and four applications](https://www.bctengineer.com/question.md?key=semester_3%2Ffluid_mechanics%3Abernoulli-from-euler-applications) — Fluid Mechanics, chapter 5
- [Ideal central tendency; correct mean and SD](https://www.bctengineer.com/question.md?key=semester_5%2Fprobability_and_statistics%3Acharacteristics-ideal-central-tendency) — Probability and Statistics, chapter 1
