Solved exercises

Worked problems with concrete data and their detailed solution.

Foundations

Exercise: iterative error with e^0.5

Approximating e0.5e^{0.5} by its Taylor series, adding terms until the percentage iterative error drops below 0.05 %.

Interpolation

Exercise: Newton with population data

Full divided-difference table for the 1971–2011 census and estimate of the 2005 population with the degree-4 Newton polynomial.

Differentiation

Exercise: comparing derivative formulas

Computing f(0.5)f'(0.5) for f(x)=x2exf(x)=x^2e^{-x} with the six finite-difference formulas and comparing their errors against the exact value 0.45490.4549.

Exercise: Richardson on ln(x)

Approximating f(1.8)f'(1.8) for f(x)=lnxf(x)=\ln x with O(h)\mathcal{O}(h) forward differences and improving to O(h2)\mathcal{O}(h^2) via Richardson extrapolation.

Integration

Exercise: trapezoid and midpoint

Comparing composite trapezoid, simple midpoint and composite midpoint, with absolute and relative errors.

Exercise: double integral of a surface

Comparison between double Simpson and Gauss-Legendre for an integral derived from the hemisphere x2+y2+f2=9x^2+y^2+f^2=9.

ODEs

Exercise: stability of explicit and implicit Euler

Full analysis of y=λyy'=\lambda y: the amplification factor of each method, the explicit method's stability condition h<2/λh<-2/\lambda, the unconditional stability of the implicit one and a numerical check with λ=10\lambda=-10.

Exercise: AB2 and order estimation

Solving a logistic IVP (Verhulst) with AB2 started with Heun and estimating the order numerically by doubling the number of subintervals.

Linear systems

Exercise: convergence by spectral radius

A non-diagonally-dominant matrix where Jacobi diverges but Gauss-Seidel converges, decided by computing the spectral radius of each iteration matrix.

Nonlinear equations

Exercise: bisection by hand

Six bisection iterations for cos²x−x=0 on [0,1], with the chain of intervals, the error bound at each step and the prediction of the required number of iterations.

Exercise: Newton on x=cos²x

Full application of Newton's method to x=cos²x from x0=0.3: table of iterates, residuals, increments and ACOC tending to the theoretical order 2.

Exercise: the secant by hand

The secant method applied to cos²x−x=0 from x0=0, x1=1: five iterations with explicit divided differences and superlinear convergence on display.

Exercise: numerical comparison of iterative methods

Newton, Halley, Ostrowski, Traub, midpoint, Jarratt and double Newton on test functions with tolerance 10⁻¹⁰⁰: iterations, residuals and ACOC confirming the theoretical orders.

Nonlinear systems

Exercise: Newton for a system, by hand

Two Newton steps by hand on the system x2+y2=1x^2+y^2=1, x=yx=y: building the Jacobian, solving each step's 2×22\times2 linear system and visible quadratic convergence towards (2/2,2/2)(\sqrt2/2,\sqrt2/2).

Exercise: Newton on a 2×2 system with iteration table

Full solution of exey+xcosy=0e^x e^y+x\cos y=0, x+y=1x+y=1 with Newton from [2,1][2,-1]: table of iterates, residual and increment norms, and ACOC settling at 2.

Exercise: numerical comparison on systems

Newton, Trapezoids, Golden Ratio, NA, Jarratt and RN on two test systems with tolerance 10⁻¹²: iterations, norms and ACOC, with RN (order 6) as the most effective method.