CSC212 · 2075 · 10 marks
What is non-linear equation? Derive the required expression to calculate the root of non-linear equation using secant method. Using this expression find a root of following equation.
What is non-linear equation? Derive the required expression to calculate the root of non-linear equation using secant method. Using this expression find a root of following equation.
$$x^2 + \cos(x) - e^{-x} - 2 = 0$$
[10]
Non-Linear Equations and the Secant Method
1. Non-Linear Equation
A non-linear equation is an equation $f(x)=0$ in which the unknown appears in a degree higher than one, or inside transcendental functions (trigonometric, exponential, logarithmic). Its graph is not a straight line, and it generally cannot be solved by direct algebraic manipulation, so iterative numerical methods are used.
Examples: $x^2+\cos x-e^{-x}-2=0$, $x^3-4x+1=0$, $e^x-3x=0$.
2. Derivation of the Secant Method
Start from the Newton-Raphson formula:
$$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$$
The Secant method replaces the analytic derivative with a finite-difference approximation using two known points:
$$f'(x_n)\approx\frac{f(x_n)-f(x_{n-1})}{x_n-x_{n-1}}$$
Substituting:
$$\boxed{x_{n+1}=x_n-\frac{f(x_n),(x_n-x_{n-1})}{f(x_n)-f(x_{n-1})}}$$
This needs two initial guesses $x_0,,x_1$.
3. Numerical Solution
$$f(x)=x^2+\cos x-e^{-x}-2$$
(radian mode)
Bracketing:
| $x$ | $f(x)$ |
|---|---|
| 1 | $1+0.5403-0.3679-2=-0.8276$ |
| 2 | $4-0.4161-0.1353-2=+1.4486$ |
Root lies in $(1,2)$. Take $x_0=1,\ x_1=2$.
Iteration 1
$$x_2=2-\frac{1.4486(2-1)}{1.4486-(-0.8276)}=2-\frac{1.4486}{2.2762}=2-0.6364=1.3636$$
$$f(1.3636)=1.8594+0.2050-0.2557-2$$
Check $\cos(1.3636)=0.2064$ (radians), $e^{-1.3636}=0.2557$, $(1.3636)^2=1.8594$: $$f(1.3636)=1.8594+0.2064-0.2557-2=-0.1899$$
Iteration 2
$$x_3=1.3636-\frac{(-0.1899)(1.3636-2)}{-0.1899-1.4486}$$ $$=1.3636-\frac{(-0.1899)(-0.6364)}{-1.6385}=1.3636-\frac{0.1209}{-1.6385}$$ $$=1.3636+0.0738=1.4374$$
$$f(1.4374)=2.0661+\cos(1.4374)-e^{-1.4374}-2$$ $\cos(1.4374)=0.1330,\ e^{-1.4374}=0.2375$ $$=2.0661+0.1330-0.2375-2=-0.0384$$
Iteration 3
$$x_4=1.4374-\frac{(-0.0384)(1.4374-1.3636)}{-0.0384-(-0.1899)}$$ $$=1.4374-\frac{(-0.0384)(0.0738)}{0.1515}=1.4374-\frac{-0.002834}{0.1515}$$ $$=1.4374+0.0187=1.4561$$
$$f(1.4561)=2.1202+\cos(1.4561)-e^{-1.4561}-2$$ $\cos(1.4561)=0.1145,\ e^{-1.4561}=0.2331$ $$=2.1202+0.1145-0.2331-2=+0.0016$$
Iteration 4
$$x_5=1.4561-\frac{(0.0016)(1.4561-1.4374)}{0.0016-(-0.0384)}$$ $$=1.4561-\frac{0.0016\times0.0187}{0.0400}=1.4561-0.00075=1.4553$$
$f(1.4553)\approx 0.0000$.
Result
$$\boxed{x\approx 1.4553}$$
Watch the trigonometry: $\cos(1.3636) \approx 0.2064$, not $0.2190$, so $f(1.3636) \approx -0.19$ rather than $-0.1773$. The slip does not move the converged root, which stays at $\approx 1.455$.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.