Preface 

xi  
Examples/Mathcad Functions/Algorithms 

xiii  


1  (46) 

Sample Problems and Numerical Methods 


4  (6) 

Roots of Nonlinear Equations 


4  (1) 


5  (1) 


6  (1) 


7  (1) 


8  (1) 


8  (2) 


10  (18) 

Key Issues for Iterative Methods 


10  (4) 


14  (8) 


22  (6) 

Getting Started in Mathcad 


28  (19) 

Overview of the Mathcad Workspace 


28  (3) 

Mathematical Computations 


31  (1) 

Operators on the Math Toolbars 


32  (3) 


35  (3) 


38  (9) 

Solving Equations of One Variable 


47  (46) 


50  (5) 


50  (2) 

Mathcad Function for Bisection 


52  (2) 


54  (1) 

Regula Falsi and Secant Methods 


55  (13) 

StepbyStep Computation for Regula Falsi 


56  (2) 

Mathcad Function for the Regula Falsi Method 


58  (2) 

StepbyStep Computation for the Secant Method 


60  (2) 

Mathcad Function for the Secant Method 


62  (2) 


64  (4) 


68  (7) 


68  (2) 

Mathcad Function for Newton's Method 


70  (2) 


72  (3) 


75  (6) 

StepbyStep Computation for Muller's Method 


76  (2) 

Mathcad Function for Muller's Method 


78  (2) 


80  (1) 


81  (12) 

Using the BuiltIn Functions 


81  (3) 

Understanding the Algorithms 


84  (9) 

Solving Systems of Linear Equations: Direct Methods 


93  (38) 


96  (10) 


97  (1) 


98  (3) 

Mathcad Function for Basic Gaussian Elimination 


101  (2) 


103  (3) 

Gaussian Elimination with Row Pivoting 


106  (7) 


106  (4) 

Mathcad Function for Gaussian Elimination with Pivoting 


110  (3) 


113  (1) 

Gaussian Elimination for Tridiagonal Systems 


113  (9) 


116  (2) 

Mathcad Function for the Thomas Method 


118  (1) 


119  (3) 


122  (9) 

Using the BuiltIn Functions 


122  (1) 

Understanding the Algorithms 


122  (9) 

Solving Systems of Linear Equations: Iterative Methods 


131  (40) 


135  (9) 

StepbyStep Procedure for Jacobi Iteration 


136  (3) 

Mathcad Function for the Jacobi Method 


139  (3) 


142  (2) 


144  (7) 

StepbyStep Computation for GaussSeidel Method 


145  (3) 

Mathcad Function for GaussSeidel Method 


148  (2) 


150  (1) 

Successive Overrelaxation 


151  (6) 

StepbyStep Computation of SOR 


152  (2) 


154  (1) 


155  (2) 


157  (14) 

Using the BuiltIn Functions 


157  (2) 

Understanding the Algorithms 


159  (12) 

Systems of Equations and Inequalities 


171  (30) 

Newton's Method for Systems of Equations 


174  (7) 


176  (1) 

Mathcad Function for Newton's Method 


177  (4) 

FixedPoint Iteration for Nonlinear Systems 


181  (6) 


182  (1) 

Mathcad Function for FixedPoint Iteration for Nonlinear Systems 


182  (4) 


186  (1) 

Minimum of Nonlinear Function 


187  (5) 

StepbyStep Computation of Minimization by Gradient Descent 


187  (1) 

Mathcad Function for Minimization by Gradient Descent 


188  (4) 


192  (9) 

Using the BuiltIn Functions 


192  (1) 

Understanding the Algorithms 


193  (8) 


201  (32) 

LU Factorization from Gaussian Elimination 


203  (4) 

A StepbyStep Procedure for LU Factorization 


204  (2) 

Mathcad Function for LU Factorization Using Gaussian Elimination 


206  (1) 

LU Factorization of Tridiagonal Matrices 


207  (2) 

StepbyStep LU Factorization of a Tridiagonal Matrix 


207  (1) 

Mathcad Function for LU Factorization of a Tridiagonal Matrix 


208  (1) 

LU Factorization with Pivoting 


209  (6) 


209  (1) 

Mathcad Function for LU Factorization with Row Pivoting 


210  (2) 


212  (3) 


215  (4) 

Direct LU Factorization of a General Matrix 


215  (2) 

LU Factorization of a Symmetric Matrix 


217  (2) 

Applications of LU Factorization 


219  (7) 

Solving a Tridiagonal System Using LU Factorization 


222  (2) 


224  (1) 


224  (2) 


226  (7) 

Using the BuiltIn Functions 


226  (1) 

Understanding the Algorithms 


226  (7) 

Eigenvalues, Eigenvectors, and QR Factorization 


233  (50) 


236  (12) 


237  (5) 


242  (5) 


247  (1) 


248  (19) 

Householder Transformations 


248  (9) 


257  (4) 


261  (6) 

Finding Eigenvalues Using QR Factorization 


267  (3) 

Basic QR Eigenvalue Method 


267  (1) 

Better QR Eigenvalue Method 


268  (2) 


270  (1) 


270  (13) 

Using the BuiltIn Functions 


270  (1) 

Understanding the Algorithms 


271  (12) 


283  (66) 


286  (24) 

Lagrange Interpolation Polynomials 


286  (9) 

Newton Interpolation Polynomials 


295  (11) 

Difficulties with Polynomial Interpolation 


306  (4) 


310  (6) 

Rational Function Interpolation 


316  (4) 


320  (14) 

Piecewise Linear Interpolation 


321  (1) 

Piecewise Quadratic Interpolation 


322  (3) 

Piecewise Cubic Interpolation 


325  (9) 


334  (15) 

Using the BuiltIn Functions 


334  (1) 

Understanding the Algorithms 


335  (14) 


349  (44) 

Least Squares Approximation 


352  (21) 

Linear LeastSquares Approximation 


352  (7) 

Quadratic LeastSquares Approximation 


359  (5) 

Cubic LeastSquares Approximation 


364  (5) 

LeastSquares Approximation for Other Functional Forms 


369  (4) 

Continuous LeastSquares Approximation 


373  (8) 

Continuous LeastSquares with Orthogonal Polynomials 


376  (1) 


376  (2) 


378  (1) 

LeastSquares Approximation with Legendre Polynomials 


379  (2) 

Function Approximation at a Point 


381  (4) 


381  (1) 

Pade Function approximation 


382  (3) 


385  (8) 

Using the Builtin Functions 


385  (1) 

Understanding the Algorithms 


386  (7) 


393  (43) 

Fourier Approximation and Interpolation 


396  (11) 

Fast Fourier Transforms for n = 2r 


407  (8) 

Discrete Fourier Transform 


407  (1) 


408  (7) 

Fast Fourier Transforms for General n 


415  (8) 


423  (13) 

Using the BuiltIn Functions 


423  (1) 

Understanding the Algorithms 


424  (12) 

Numerical Differentiation and Integration 


436  (41) 


436  (9) 


436  (4) 


440  (1) 


441  (1) 


442  (3) 

Basic Numerical Integration 


445  (7) 


446  (2) 


448  (2) 


450  (2) 

Other NewtonCotes Open Formulas 


452  (1) 

Better Numerical Integration 


452  (10) 


453  (2) 


455  (3) 

Extrapolation Methods for Quadrature 


458  (4) 


462  (6) 

Gaussian Quadrature on [1,1] 


462  (2) 

Gaussian Quadrature on [a,b] 


464  (4) 


468  (9) 


468  (1) 

Understanding the Algorithms 


469  (8) 

Ordinary Differential Equations: InitialValue Problems 


477  (52) 


479  (8) 


479  (5) 

HigherOrder Taylor Methods 


484  (3) 


487  (15) 


487  (5) 

Other SecondOrder RungeKutta Methods 


492  (2) 

ThirdOrder RungeKutta Methods 


494  (1) 

Classic RungeKutta Method 


495  (4) 

Other RungeKutta Methods 


499  (2) 

RungeKuttaFehlberg Methods 


501  (1) 


502  (12) 


502  (6) 


508  (1) 

PredictorCorrector Methods 


509  (5) 


514  (3) 


517  (12) 

Using the BuiltIn Functions 


517  (3) 

Understanding the Algorithms 


520  (9) 

Systems of Ordinary Differential Equations 


529  (46) 


532  (2) 

Systems of Two FirstOrder ODE 


534  (7) 

Euler's Method for Solving Two ODEIVPs 


534  (3) 

Midpoint Method for Solving Two ODEIVPs 


537  (4) 

Systems of FirstOrder ODEIVP 


541  (16) 

Euler's Method for Solving Systems of ODEs 


542  (2) 

RungeKutta Methods for Solving Systems of ODEs 


544  (8) 

Multistep Methods for Systems 


552  (5) 

Stiff ODE and IllConditioned Problems 


557  (2) 


559  (16) 

Using the BuiltIn Functions 


559  (3) 

Understanding the Algorithms 


562  (13) 

Ordinary Differential EquationsBoundary Value Problems 


575  (34) 

Shooting Method for Solving Linear BVP 


578  (7) 

Simple Boundary Conditions 


578  (5) 

General Boundary Condition at x = b 


583  (1) 

General Boundary Conditions at Both Ends of the Interval 


584  (1) 

Shooting Method for Solving Nonlinear BVP 


585  (7) 

Nonlinear Shooting Based on the Secant Method 


585  (3) 

Nonlinear Shooting Using Newton's Method 


588  (4) 

FiniteDifference Method for Solving Linear BVP 


592  (7) 

FiniteDifference Method for Nonlinear BVP 


599  (3) 


602  (7) 

Using the BuiltIn Functions 


602  (2) 

Understanding the Algorithms 


604  (5) 

Partial Differential Equations 


609  (58) 


613  (1) 

Heat Equation: Parabolic PDE 


614  (19) 

Explicit Method for Solving the Heat Equation 


615  (8) 

Implicit Method for Solving the Heat Equation 


623  (5) 

CrankNicolson Method for Solving the Heat Equation 


628  (4) 

Heat Equation with Insulated Boundary 


632  (1) 

Wave Equation: Hyperbolic PDE 


633  (7) 

Explicit Method for Solving Wave Equations 


634  (4) 

Implicit Method for Solving Wave Equation 


638  (2) 

Poisson Equation: Elliptic PDE 


640  (5) 

FiniteElement Method for Solving an Elliptic PDE 


645  (13) 


658  (9) 

Using the BuiltIn Functions 


658  (1) 

Understanding the Algorithms 


659  (8) 
Bibliography 

667  (6) 
Answers to Selected Problems 

673  (22) 
Index 

695  