Skip to main content

Secant: x e^x - cos x

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.

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

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

nx(n-1)x(n)f(x(n-1))f(x(n))x(n+1)
10.00001.0000-1.00002.17800.3147
21.00000.31472.1780-0.51990.4467
30.31470.4467-0.5199-0.20350.5317
40.44670.5317-0.20350.04290.5169
50.53170.51690.0429-0.00260.5177
60.51690.5177-0.0026-0.00000.5178
70.51770.5178-0.00000.00000.5178

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

Answer: root ≈ 0.5178

✓ Answer checked by Claude Opus 5.5 (high effort)

All Numerical Method chapter 2 questions →