Skip to main content

Secant: cos x + e^x - 5

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.

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

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

nx(n-1)x(n)f(x(n-1))f(x(n))x(n+1)
11.00002.0000-1.74141.97291.4688
22.00001.46881.9729-0.55401.5853
31.46881.5853-0.5540-0.13381.6224
41.58531.6224-0.13380.01351.6190
51.62241.61900.0135-0.00031.6190
61.61901.6190-0.0003-0.00001.6190

The last two iterates agree to four decimals.

Answer: root ≈ 1.6190

✓ Answer checked by Claude Opus 5.5 (high effort)

All Numerical Method chapter 2 questions →