Subjects numerical methods

Secant Errors Newton Derivative

Step-by-step solutions with LaTeX - clean, fast, and student-friendly.

Search Solutions

Secant Errors Newton Derivative


1. **Problem a:** Find the smallest positive root of $f(x) = x - e^{-x} = 0$ using the secant method. Step 1: State the function: $f(x) = x - e^{-x}$. Step 2: Choose initial approximations near the root. Since $f(0) = 0 - 1 = -1$ and $f(1) = 1 - e^{-1} \approx 1 - 0.3679 = 0.6321 > 0$, the root lies between 0 and 1. Use $x_0 = 0$ and $x_1 = 1$. Step 3: Apply the secant method formula: $$x_{n+1} = x_n - f(x_n) \frac{x_n - x_{n-1}}{f(x_n) - f(x_{n-1})}$$ Step 4: Iterations: - $x_2 = 1 - 0.6321 \times \frac{1 - 0}{0.6321 - (-1)} = 1 - 0.6321 \times \frac{1}{1.6321} \approx 1 - 0.387 = 0.613$ - $f(0.613) = 0.613 - e^{-0.613} \approx 0.613 - 0.541 = 0.072$ - $x_3 = 0.613 - 0.072 \times \frac{0.613 - 1}{0.072 - 0.6321} = 0.613 - 0.072 \times \frac{-0.387}{-0.56} \approx 0.613 - 0.05 = 0.563$ - $f(0.563) = 0.563 - e^{-0.563} \approx 0.563 - 0.569 = -0.006$ - $x_4 = 0.563 - (-0.006) \times \frac{0.563 - 0.613}{-0.006 - 0.072} = 0.563 + 0.006 \times \frac{-0.05}{-0.078} \approx 0.563 + 0.004 = 0.567$ - $f(0.567) \approx 0.567 - e^{-0.567} = 0.567 - 0.567 = 0$ Step 5: Root correct to three decimal places is $x \approx 0.567$. 2. **Problem b:** Approximate value of $\frac{2}{3} = 0.6667$. Step 1: Exact value: $\frac{2}{3} = 0.666666\ldots$ Step 2: Absolute error = $|0.6667 - 0.666666\ldots| = 0.0000333$ (approx) Step 3: Relative error = $\frac{\text{absolute error}}{\text{exact value}} = \frac{0.0000333}{0.666666\ldots} \approx 5 \times 10^{-5}$. 3. **Problem c:** Find $f(x)$ as a polynomial using Newton's divided difference formula for points: $x = [-2, -1, 0, 1, 3, 4]$, $f(x) = [9, 16, 17, 18, 44, 81]$. Step 1: Compute divided differences: - $f[-2] = 9$ - $f[-1] = 16$ - $f[0] = 17$ - $f[1] = 18$ - $f[3] = 44$ - $f[4] = 81$ First order: - $f[-1,-2] = \frac{16-9}{-1+2} = 7$ - $f[0,-1] = \frac{17-16}{0+1} = 1$ - $f[1,0] = \frac{18-17}{1-0} = 1$ - $f[3,1] = \frac{44-18}{3-1} = 13$ - $f[4,3] = \frac{81-44}{4-3} = 37$ Second order: - $f[0,-1,-2] = \frac{1-7}{0+2} = -3$ - $f[1,0,-1] = \frac{1-1}{1+1} = 0$ - $f[3,1,0] = \frac{13-1}{3-0} = 4$ - $f[4,3,1] = \frac{37-13}{4-1} = 8$ Third order: - $f[1,0,-1,-2] = \frac{0 - (-3)}{1+2} = 1$ - $f[3,1,0,-1] = \frac{4-0}{3+1} = 1$ - $f[4,3,1,0] = \frac{8-4}{4-0} = 1$ Fourth order: - $f[3,1,0,-1,-2] = \frac{1-1}{3+2} = 0$ - $f[4,3,1,0,-1] = \frac{1-1}{4+1} = 0$ Fifth order: - $f[4,3,1,0,-1,-2] = \frac{0-0}{4+2} = 0$ Step 2: Newton polynomial: $$f(x) = 9 + 7(x+2) - 3(x+2)(x+1) + 1(x+2)(x+1)x$$ Step 3: Simplify polynomial: - Expand terms: $$7(x+2) = 7x + 14$$ $$-3(x+2)(x+1) = -3(x^2 + 3x + 2) = -3x^2 - 9x - 6$$ $$1(x+2)(x+1)x = x(x^2 + 3x + 2) = x^3 + 3x^2 + 2x$$ Sum all: $$f(x) = 9 + 7x + 14 - 3x^2 - 9x - 6 + x^3 + 3x^2 + 2x = x^3 + ( -3x^2 + 3x^2 ) + (7x - 9x + 2x) + (9 + 14 - 6)$$ $$= x^3 + 0x^2 + 0x + 17 = x^3 + 17$$ Step 4: Interpolate at $x=0.5$: $$f(0.5) = (0.5)^3 + 17 = 0.125 + 17 = 17.125$$ 4. **Problem d:** Find $f'(3)$ from the table: | x | 3.0 | 3.2 | 3.4 | 3.6 | 3.8 | 4.0 | | f(x) | -14 | -10.032 | -5.296 | -0.256 | 6.672 | 14 | Step 1: Use central difference formula for derivative at $x=3.0$: $$f'(3) \approx \frac{f(3.2) - f(3.0)}{3.2 - 3.0} = \frac{-10.032 - (-14)}{0.2} = \frac{3.968}{0.2} = 19.84$$ Step 2: For better accuracy, use forward difference with second order: $$f'(3) \approx \frac{-3f(3) + 4f(3.2) - f(3.4)}{2 \times 0.2} = \frac{-3(-14) + 4(-10.032) - (-5.296)}{0.4} = \frac{42 - 40.128 + 5.296}{0.4} = \frac{7.168}{0.4} = 17.92$$ Step 3: Final estimate for $f'(3)$ is approximately $17.92$. **Final answers:** - a) Root $\approx 0.567$ - b) Absolute error $\approx 0.0000333$, Relative error $\approx 5 \times 10^{-5}$ - c) Polynomial $f(x) = x^3 + 17$, $f(0.5) = 17.125$ - d) $f'(3) \approx 17.92$