# Learn Numerical Analysis with Burden and Faires 9th Edition: Exercises and Answers

# Numerical Analysis: A Practical Introduction ## What is Numerical Analysis? ### Definition and Scope ### History and Applications ## Basic Concepts and Tools ### Errors and Approximations ### Algorithms and Convergence ### Numerical Software and Programming ## Solving Equations and Systems ### Root-Finding Methods ### Linear Systems and Matrix Decomposition ### Nonlinear Systems and Iterative Methods ## Interpolation and Approximation ### Polynomial Interpolation ### Splines and Piecewise Polynomials ### Least-Squares Approximation ## Numerical Differentiation and Integration ### Finite Difference Formulas ### Numerical Quadrature Rules ### Adaptive Integration Methods ## Numerical Solutions of Differential Equations ### Initial Value Problems and Euler's Method ### Higher-Order and Multistep Methods ### Boundary Value Problems and Finite Difference Methods Based on this outline, I will write the article in the next message. Please wait for a few moments while I generate the content. Thank you for your patience.? OK, here is the article I wrote based on the outline. I hope you like it.? # Numerical Analysis: A Practical Introduction Numerical analysis is the branch of mathematics that deals with the development and application of numerical methods to solve problems that cannot be solved analytically. In this article, we will introduce some of the basic concepts and tools of numerical analysis, and explore some of the most common techniques for solving equations and systems, interpolation and approximation, numerical differentiation and integration, and numerical solutions of differential equations. We will also discuss some of the advantages and limitations of numerical methods, and how to use numerical software and programming to implement them. ## What is Numerical Analysis? Numerical analysis is a broad and interdisciplinary field that encompasses many aspects of mathematics, science, engineering, and computing. It can be defined as follows: ### Definition and Scope Numerical analysis is the study of algorithms for obtaining numerical solutions of mathematical problems that arise in various disciplines. Some examples of such problems are: - Finding the roots of a nonlinear equation or a system of equations - Solving a linear system of equations or a matrix eigenvalue problem - Interpolating or approximating a function or data - Computing the derivative or integral of a function - Solving an ordinary or partial differential equation - Optimizing a function or a system - Simulating a physical phenomenon or a complex system Numerical analysis is not only concerned with finding numerical solutions, but also with analyzing their accuracy, efficiency, stability, and reliability. Numerical analysis also investigates the properties and behavior of numerical algorithms, such as their convergence, error bounds, complexity, and stability. ### History and Applications Numerical analysis has a long and rich history that dates back to ancient times. Some of the earliest numerical methods were developed by Babylonians, Egyptians, Greeks, Chinese, Indians, and Arabs for solving problems in astronomy, geometry, algebra, trigonometry, and calculus. Some of the famous mathematicians who contributed to the development of numerical analysis include Archimedes, Newton, Euler, Gauss, Jacobi, Lagrange, Fourier, Riemann, Runge, Kutta, Taylor, Richardson, and many others. Numerical analysis has many applications in various fields of science and engineering. Some examples are: - Astronomy: computing the orbits of planets and satellites - Physics: simulating the motion of particles and fluids - Chemistry: modeling the structure and reactions of molecules - Biology: analyzing the dynamics of populations and ecosystems - Medicine: diagnosing diseases and designing drugs - Engineering: designing structures and machines - Economics: forecasting markets and optimizing resources - Computer science: developing algorithms and software Numerical analysis is also closely related to other branches of mathematics, such as: - Analysis: studying the properties and behavior of functions and operators - Linear algebra: manipulating matrices and vectors - Calculus: computing derivatives and integrals - Differential equations: modeling change and evolution - Optimization: finding extrema of functions and systems - Probability and statistics: analyzing data and uncertainty ## Basic Concepts and Tools In this section, we will introduce some of the basic concepts and tools that are essential for understanding and applying numerical methods. These include: ### Errors and Approximations One of the main challenges in numerical analysis is to deal with errors and approximations that arise from various sources. These include: - Round-off errors: errors caused by the finite precision of arithmetic operations on computers. For example, if we try to represent the irrational number $\pi$ by a finite decimal number on a computer, we will inevitably lose some digits after a certain point. This can affect the accuracy of our calculations. - Truncation errors: errors caused by replacing an exact mathematical expression by an approximate one. For example, if we try to approximate a function by a polynomial or a series expansion, we will inevitably neglect some terms after a certain point. This can affect the accuracy of our approximations. - Propagation errors: errors caused by accumulating or magnifying previous errors in subsequent calculations. For example, if we use an inaccurate value as an input for another calculation, we will obtain an inaccurate output. This can affect the reliability of our results. To measure and control errors in numerical methods, we need to use some concepts from error analysis. These include: - Absolute error: the difference between an exact value and an approximate value. For example, if $x$ is an exact value and $\tildex$ is an approximate value, $$\textabsolute error = x - \tildex$$ - Relative error: the ratio between the absolute error and the exact value. For example, $$\textrelative error = \fracx - \tildex$$ - Error bound: an upper limit for the absolute or relative error. For example, if we know that the absolute error is less than or equal to $\epsilon$, we can write $$x - \tildex \leq \epsilon$$ - Significant digits: the number of digits in an approximate value that are correct with respect to the exact value. For example, if the exact value of $\pi$ is 3.141592653589793, and the approximate value is 3.1416, then the approximate value has four significant digits. ### Algorithms and Convergence Another important concept in numerical analysis is the notion of an algorithm. An algorithm is a finite and well-defined sequence of steps or rules that can be followed to perform a specific task or solve a specific problem. For example, an algorithm for finding the square root of a positive number $a$ is: - Start with an initial guess $x_0 > 0$ - Repeat the following steps until a desired accuracy is reached: - Compute a new guess $x_n+1 = \frac12(x_n + \fracax_n)$ - Compute the absolute error $e_n = x_n - x_n+1$ - Return the final guess $x_n+1$ as the approximate square root of $a$ An algorithm can be implemented on a computer using a programming language, such as Python, C++, Java, etc. An algorithm can also be represented by a flowchart, a diagram that shows the logical steps and decisions involved in the algorithm. One of the main goals of numerical analysis is to design and analyze algorithms that are efficient, accurate, and stable. To evaluate the performance of an algorithm, we need to use some concepts from convergence analysis. These include: - Convergence: the property of an algorithm that guarantees that its output approaches a desired value as the input or the number of iterations increases. For example, the algorithm for finding the square root of $a$ converges to $\sqrta$ as $n$ increases. - Rate of convergence: the speed at which an algorithm converges to a desired value. For example, the algorithm for finding the square root of $a$ converges quadratically, meaning that the number of correct digits in the output doubles with each iteration. - Order of convergence: a measure of the rate of convergence of an algorithm. For example, the order of convergence of the algorithm for finding the square root of $a$ is 2, meaning that there exists a constant $C > 0$ such that $$\lim_n \to \infty \fracx_n - \sqrta = C$$ - Complexity: a measure of the amount of resources (such as time or memory) required by an algorithm to perform a task or solve a problem. For example, the complexity of an algorithm can be expressed by its running time as a function of its input size. ### Numerical Software and Programming Numerical analysis is not only a theoretical discipline, but also a practical one. To apply numerical methods to real-world problems, we need to use numerical software and programming tools that can help us implement and execute numerical algorithms on computers. Numerical software is a collection of programs or libraries that provide ready-made numerical algorithms for various tasks and problems. Some examples of numerical software are: - MATLAB: a high-level programming language and environment for numerical computing, visualization, and application development. - NumPy: a Python library for scientific computing that provides support for multidimensional arrays and matrices, linear algebra, random number generation, and Fourier transforms. - SciPy: a Python library for scientific computing that provides modules for optimization, interpolation, integration, statistics, signal processing, and more. - R: a programming language and environment for statistical computing and graphics. - Mathematica: a symbolic and numerical computing system that provides support for algebra, calculus, differential equations, graphics, and more. Numerical programming is the process of writing code or scripts that use numerical software or libraries to implement and execute numerical algorithms on computers. Numerical programming requires some knowledge and skills in: - Programming languages: such as Python, C++, Java, etc. - Programming paradigms: such as procedural, object-oriented, functional, etc. - Programming concepts: such as variables, data types, operators, expressions, statements, functions, loops, conditionals, arrays, matrices, etc. - Programming tools: such as editors, compilers, interpreters, debuggers, etc. Numerical programming also requires some good practices and habits in: - Documentation: writing clear and concise comments and descriptions for your code - Testing: checking your code for errors and bugs using test cases and examples - Debugging: finding and fixing errors and bugs OK, here is the rest of the article I wrote based on the outline. I hope you like it.? ## Solving Equations and Systems One of the most common tasks in numerical analysis is to solve equations and systems that arise from various models and problems. In this section, we will introduce some of the most common techniques for solving equations and systems, such as: ### Root-Finding Methods A root-finding problem is to find a value of $x$ that satisfies an equation of the form $$f(x) = 0$$ where $f$ is a given function. For example, finding the roots of a polynomial, a trigonometric function, or a transcendental function are all root-finding problems. There are many numerical methods for finding roots of equations, such as: - Bisection method: a method that divides an interval containing a root into two subintervals, and repeats the process on the subinterval that contains the root until a desired accuracy is reached. The bisection method is simple, robust, and guaranteed to converge, but it is slow and requires that the function changes sign at the root. - Newton's method: a method that starts with an initial guess $x_0$, and computes a sequence of improved guesses $x_n+1 = x_n - \fracf(x_n)f'(x_n)$, where $f'$ is the derivative of $f$. Newton's method is fast and has quadratic convergence, but it requires that the function is differentiable and that the initial guess is close to the root. - Secant method: a method that starts with two initial guesses $x_0$ and $x_1$, and computes a sequence of improved guesses $x_n+1 = x_n - f(x_n) \fracx_n - x_n-1f(x_n) - f(x_n-1)$. The secant method is similar to Newton's method, but it does not require the derivative of $f$. The secant method has superlinear convergence, but it may fail if the denominator becomes zero or if the guesses diverge. ### Linear Systems and Matrix Decomposition A linear system problem is to find a vector $\mathbfx$ that satisfies a system of equations of the form $$\mathbfA\mathbfx = \mathbfb$$ where $\mathbfA$ is a given matrix and $\mathbfb$ is a given vector. For example, solving a system of linear equations, a system of linear differential equations, or a system of linear constraints are all linear system problems. There are many numerical methods for solving linear systems, such as: - Gaussian elimination: a method that transforms a given matrix into an upper triangular matrix by performing elementary row operations, and then solves the system by back substitution. Gaussian elimination is simple and exact (up to round-off errors), but it requires many arithmetic operations and may be unstable if the matrix is ill-conditioned or singular. - LU decomposition: a method that decomposes a given matrix into a product of a lower triangular matrix and an upper triangular matrix, $\mathbfA = \mathbfL\mathbfU$, and then solves the system by forward and back substitution. LU decomposition reduces the number of arithmetic operations compared to Gaussian elimination, but it still requires pivoting to avoid zero or small diagonal elements. - QR decomposition: a method that decomposes a given matrix into a product of an orthogonal matrix and an upper triangular matrix, $\mathbfA = \mathbfQ\mathbfR$, and then solves the system by multiplying by the transpose of $\mathbfQ$ and back substitution. QR decomposition is more stable than LU decomposition, but it requires more arithmetic operations. ### Nonlinear Systems and Iterative Methods A nonlinear system problem is to find a vector $\mathbfx$ that satisfies a system of equations of the form $$\mathbfF(\mathbfx) = \mathbf0$$ where $\mathbfF$ is a given vector-valued function. For example, finding the equilibrium points of a dynamical system, or finding the solutions of a system of nonlinear algebraic equations are all nonlinear system problems. There are many numerical methods for solving nonlinear systems, such as: - Fixed-point iteration: a method that starts with an initial guess $\mathbfx_0$, and computes a sequence of improved guesses $\mathbfx_n+1 = \mathbfG(\mathbfx_n)$, where $\mathbfG$ is a given vector-valued function. Fixed-point iteration is simple and general, but it requires that the function $\mathbfG$ satisfies some conditions for convergence, such as the contraction mapping theorem. - Newton's method: a method that starts with an initial guess $\mathbfx_0$, and computes a sequence of improved guesses $\mathbfx_n+1 = \mathbfx_n - \mathbfJ^-1(\mathbfx_n)\mathbfF(\mathbfx_n)$, where $\mathbfJ$ is the Jacobian matrix of $\mathbfF$. Newton's method is fast and has quadratic convergence, but it requires that the function $\mathbfF$ is differentiable and that the Jacobian matrix is nonsingular and invertible. - Broyden's method: a method that starts with an initial guess $\mathbfx_0$ and an initial approximation of the Jacobian matrix $\mathbfB_0$, and computes a sequence of improved guesses $\mathbfx_n+1 = \mathbfx_n - \mathbfB_n^-1\mathbfF(\mathbfx_n)$, where $\mathbfB_n+1$ is updated by a rank-one formula. Broyden's method is similar to Newton's method, but it does not require the evaluation of the Jacobian matrix at each iteration. Broyden's method has superlinear convergence, but it may fail if the initial approximation of the Jacobian matrix is poor or if the updated matrix becomes singular. ## Interpolation and Approximation Another common task in numerical analysis is to interpolate or approximate a function or data that are given or measured at discrete points. In this section, we will introduce some of the most common techniques for interpolation and approximation, such as: ### Polynomial Interpolation A polynomial interpolation problem is to find a polynomial $p$ of degree at most $n$ that passes through $n+1$ given points $(x_i, y_i)$, $i = 0, 1, \dots, n$. For example, finding a polynomial that fits a curve or a data set are polynomial interpolation problems. There are many numerical methods for finding polynomial interpolants, such as: - Lagrange interpolation: a method that constructs a polynomial interpolant as a linear combination of Lagrange basis polynomials, $p(x) = \sum_i=0^n y_i L_i(x)$, where $L_i(x) = \prod_j=0,j\neq i^n \fracx - x_jx_i - x_j$. Lagrange interpolation is simple and exact, but it suffers from high degree, high oscillation, and high sensitivity to errors. - Newton interpolation: a method that constructs a polynomial interpolant as a nested form of Newton basis polynomials, $p(x) = \sum_i=0^n f[x_0,\dots,x_i] N_i(x)$, where $f[x_0,\dots,x_i]$ are the divided differences of $f$ at $x_0,\dots,x_i$, and $N_i(x) = \prod_j=0^i-1 (x - x_j)$. Newton interpolation is efficient and flexible, but it requires the computation of divided differences and may suffer from high degree and high oscillation. - Hermite interpolation: a method that constructs a polynomial interpolant that not only passes through the given points $(x_i,y_i)$, but also matches the given derivatives $y'_i$ at those points. Hermite interpolation can improve the accuracy and smoothness of the interpolant, but it requires more information and may increase the degree of the interpolant. ### Splines and Piecewise Polynomials A spline interpolation problem is to find a piecewise polynomial function $s$ that passes through $n+1$ given points $(x_i,y_i)$, $i = 0, 1, \dots, n$, and satisfies some smoothness conditions at the interior points. For example, finding a smooth curve that fits a data set or a shape are spline interpolation problems. There are many types of splines and piecewise polynomials, such as: - Linear splines: piecewise linear functions that connect the given points by straight line segments. Linear splines are simple and stable, but they are not smooth and may have large errors. - Quadratic splines: piecewise quadratic functions that have continuous first derivatives at the interior points. Quadratic splines are smoother than linear splines, but they may have large curvature and oscillation. - Cubic splines: piecewise cubic functions that have continuous first and second derivatives at the interior points. Cubic splines are smoother than quadratic splines, and they can achieve optimal approximation among all piecewise OK, here is the rest of the article I wrote based on the outline. I hope you like it.? polynomials of the same degree. Cubic splines are widely used in computer graphics, computer-aided design, and data analysis. - B-splines: piecewise polynomial functions that have a compact support and a high degree of smoothness. B-splines are flexible and stable, and they can be used to construct other types of splines, such as Bezier curves and NURBS. ### Least-Squares Approximation A least-squares approximation problem is to find a function $f$ of a given type (such as a polynomial, a trigonometric function, or an exponential function) that minimizes the sum of the squares of the errors at $n+1$ given points $(x_i,y_i)$, $i = 0, 1, \dots, n$. For example, finding a function that best fits a data set or a model are least-squares approximation problems. There are many numerical methods for finding least-squares approximants, such as: - Normal equations: a method that reduces a least-squares approximation problem to a linear system pr