Numerical Analysis - II
Numerical Analysis - II
NUMERICAL
ANALYSIS - II
MUHAMMAD USMAN HAMID
PREFACE
In the beginning of university life I used only those books which were
recommended by my teachers, soon I realized, that books were not
enough to fulfill my requirements then I used every possible way to get
any information about my topics.
Now I want to say thanks to the writers of the books which I used.
I also say thank to my parents for their valuable prayers,
To my teachers for their guidance,
To my friends for their appreciation,
And I dedicated this book to MSc Mathematics Batch 2015-2017 the
students of INSTITUTES OF LEADERSHIP AND MANAGEMENT
(ILM) SARGODHA.
This course is designed to teach the students about numerical methods and their theoretical
bases. The students are expected to know computer programming to be able to write program for
each numerical method. Knowledge of calculus and linear algebra would help in learning these
methods
Course Contents:
Forward, backward and centered difference formulae, Lagrange interpolation, Newton‟s divided
difference formula, Interpolation with a cubic spline, Hermite interpolation, least squares
approximation. Richardson‟s extrapolation, Newton-Cotes formulae, Numerical integration:
Rectangular rule, trapezoidal rule, Simpson‟s 1/3 and 3/8 rules, Boole‟s and Weddle‟s rules,
Gaussian quadrature.
The Euler and modified Euler method, Runge-Kutta methods and predictor-corrector type
methods for solving initial value problems along with convergence and instability criteria. Finite
difference, collocation and variational method for boundary value problems.
INTRODUCTION
NUMERICAL ANALYSIS:
Numerical Analysis is the branch of mathematics that provides tools and methods for solving
mathematical problems in numerical form. In numerical analysis we are mainly interested in
implementation and analysis of numerical algorithms for finding an approximate solution to a
mathematical problem.
It is the study of algorithms that use numerical approximations (as opposed to general symbolic
manipulation) for the problem of mathematical analysis (as distinguished from discrete
mathematics)
IMPORTANCE: Numerical analysis naturally finds applications in all fields of engineering and
the physical sciences, but in the 21st century, the life science and even the arts have adopted
elements of scientific computations. Ordinary differential equations appear in the movements of
heavenly bodies (planets, stars, galaxies); optimization occurs in portfolio management;
numerical linear algebra is important for data analysis; stochastic differential equations and
Markov chains are essential in simulating living cells for medicine and biology.
Before the advent of modern computers numerical methods often depended
on hand interpolation in large printed tables. Since the mid-20th century, computers calculate the
required functions instead. These same interpolation formulas nevertheless continues to be used
a part of the software algorithms for solving differential equations.
The overall goal of the field of numerical analysis is the design and analysis of techniques to
give approximate but accurate solutions to hard problems, the variety of which is suggested by
the following;
HISTORY:
The field of numerical analysis predates the invention of modern computers by many centuries.
Linear interpolation was already in use more than 2000 year ago. Many great mathematicians of
the past were preoccupied by numerical analysis, as is obvious from the names of important
algorithms like Newton‟s method, Lagrange‟s interpolation polynomial, Gaussian elimination or
Euler‟s method.To facilitate computations by hand, large books were produced with formulas
and tables of data such as interpolation points and function coefficients. Using these tables, often
calculated out to 16 decimal places or more for some functions, one could look up values to plug
into the formulas given and achieve very good numerical estimates of some functions. The
canonical work in the field is the NIST publications edited by Abramovitz and Stegun, a 1000
plus page book of a very large number of commonly used formulas and functions and their
values at many points. The function values are no longer very useful when a computer is
available, but the large listing of formulas can still be very handy.
The mechanical calculator was also developed as a tool for hand computation. These calculators
evolved into electronic computers in the 1940‟s and it was then found that these computers were
also useful for administrative purposes. But the invention of the computer also influenced the
field of numerical analysis, since now longer and more complicated calculations could be done.
Direct methods compute the solution to a problem in a finite number of
steps. These methods would give the precise answer if they were performed in infinite precision
arithmetic. Examples include Gaussian elimination, the QR factorization method for solving the
system of linear equations and the simplex method of linear programming. In practice, finite
precision is used and the result is an approximation of the true solution (assuming stability)
In contrast to direct methods, iterative methods are not expected to terminate in a number of
steps. Starting from an initial guess, iterative methods from successive approximations that
converge to the exact solution only in the limit. A convergence test is specified in order to decide
when a sufficiently accurate solution has (hopefully) been found. Even using infinite precision
arithmetic these methods would not reach the solution within a finite number of steps (in
general). Examples include Newton‟s method, the Bisection method and Jacobi iteration. In
computational matrix algebra, iterative methods are generally needed for large problems.
Iterative methods are more common than direct methods in numerical analysis. Some methods
are direct in principle but are usually use as though they were not, e.g. GMRES and the
conjugate gradient method. For these methods the number of steps needed to obtain the exact
solution is so large that an approximation is accepted in the same manner as for an iterative
method.
A complete set of rules for solving a problem or problems of a particular type involving only the
operation of arithmetic.
OR: A mathematical procedure that generates a sequence of improving approximate solution for
a class of problems i.e. the process of finding successive approximations.
STABLE ALGORITHM:
Algorithm for which the cumulative effect of errors is limited, so that a useful result is generated
is called stable algorithm. Otherwise Unstable.
NUMERICAL STABILITY:
Numerical stability is a procedure that is about how a numerical scheme propagates error.
If the method leads to the value close to the exact solution, then we say that the method is
convergent otherwise the method is divergent. i.e.
LOCAL CONVERGENCE:
An iterative method is called locally convergent to a root, if the method converges to root for
initial guesses sufficiently close to root.
Suppose that the sequence (xn) converges to “r” then the sequence (xn) is said to converge to “r”
with order of convergence “a” if there exist a positive constant “p” such that
Thus if , the convergence is
linear. If , the convergence is quadratic and so on. Where the number “a” is called
convergence factor.
REMARK
Let (x0, x1,x2,.......)be a sequence that converges to a number “a” and set Ɛn=a - xn
If there exist a number “k” and a positive constant “c” such that
Then “k” is called order of convergence of the sequence and “c” the asymptotic error constant.
CONSISTENT METHOD:
PRECISION:
Precision mean how close are the measurements obtained from successive iterations.
ACCURACY:
Accuracy means how close are our approximations from exact value.
It is the largest positive integer “n” such that the formula is exact for “xk ” for each
(k = 0,1,2,……n). i.e. Polynomial integrated exactly by method.
A problem is well conditioned if small change in the input information causes small change in
the output. Otherwise it is ill conditioned.
ZERO STABILITY:
A numerical IVP solver is Zero Stable if small perturbation in the initial conditions do not cause
the numerical approximation to diverge away from the true solution provided the true solution of
the IVP is bounded.
A_STABILITY:
A numerical IVP solver is A- Stable if its region of absolute stability includes the entire complete
half plane with negative real part,
The common difference between the points i.e. h = = ti+1 - ti is called step-size.
There are two types of methods to find the roots of Algebraic and Transcendental equations.
DIRECT METHODS
1. Methods which calculate the required solution without any initial approximation in finite
number of steps.
2. Direct methods give the exact value of the roots in a finite number of steps.
3. These methods determine all the roots at the same time assuming no round off errors.
4. In the category of direct methods; Elimination Methods are advantageous because they
can be applied when the system is large.
5. Examples; Gauss‟s Elimination method, Gauss‟s Jordan method, Cholesky‟s method.
These methods require the limits between which the root lies. e.g. Bisection method, False
position method.
OPEN METHODS
These methods require the initial estimation of the solution. e.g. Newton Raphson method.
The main disadvantage is, if it is not possible to bracket the root, the method cannot applicable.
In these methods we choose two points “xn” and “xn-1” such that f(xn) and f(xn-1) are of opposite
signs. Intermediate value property suggests that the graph of “y=f(x)” crosses the x-axis between
these two points, therefore a root (say) “x=xr” lies between these two points.
REMARK: Always set your calculator at radian mod while solving Transcendental or
Trigonometric equations.
We can find the approximate value of the root of f(x)=0 by “Graphical method” or by
“Analytical method”.
DIFFERENCE OPERATORS
DIFFERENCE EQUATION
Equation involving differences is called Difference Equation.
OR an equation that consist of an independent variable „t‟, a dependent variable „y(t)‟ and one or
more several differences of the dependent variable as is called difference
equation.
The functional relationship of the difference equation is
Solution of differential equation will be sequence of values for which the equation is true for
some set of consecutive integer „t‟.
Importance: difference equation plays an important role in problem where there is a quantity „y‟
that depends on a continuous independent variable „t‟
In polynomial dynamics, modeling the rate of change of the population or modeling the growth
rate yields a differential equation for the population „y‟ as the function of time „t‟
i.e.
In differential equation models, usually the population is assumed to vary continuously I time.
Difference equation model arise when the population is modeled only at certain discrete time.
DIFFERENCE OF A POLYNOMIAL
The “nth” difference of a polynomial of degree „n‟ is constant, when the values of the
independent variable are given at equal intervals.
EXAMPLES:
i.
ii.
Order of differential equation is the difference between the largest and smallest argument „t‟
appearing in it.
For example; if then
Degree of differential equation is the highest power of „y‟
For example; if then
FINITE DIFFERENCES: Let we have a following linear D. Equation
and
DIFFERENCE TABLE: The standard format for displaying finite differences is called
difference table.
The differences of a constant function are zero. In symbol where „c‟ denotes a
constant. For a constant time another function we have
PROVE THAT
REMEMBER: The fundamental idea behind finite difference methods is the replace derivatives
in the differential equation by discrete approximations, and evaluate on a grid to develop a
system of equations.
COLLOCATION : Like the finite difference methods, the idea behind the collocation is to
reduce the boundary value problem to a set of solvable algebraic equations.
However, instead of discretizing the differential equation by replacing derivative with finite
differences, the solution is given a functional from whose parameters are fit by the method.
In General:
Remark:
QUESTION:
SOLUTION
= - = ( - ) - ( - ) = -2 +
= - = - -( - )
= - -( - ) -( - )+( - ) = -4 + -4 +
QUESTION: Compute the missing values of and in the following table.
=6
=5
=1 =4 =13 =18 =24
SOLUTION
=1
=4
=13
=18
=24
=4 and =5 5 =4
(1) =1 =0
(4)
(5)
5=6 and
QUESTION :
Show that the value of „yn‟ can be expressed in terms of the leading value‟ „and the Binomial
leading differences .....
SOLUTION
Similarly
Similarly
In general
Hence
= (OR)
(OR)
QUESTION: Show that any value of „y‟ can be expressed in terms of and its backward
differences.
Also (2)
(1)
In General
i.e.
OR OR
(OR) ( ) ( ) (OR)
AVERAGE OPERATOR “
[ ]
(OR) ( ) ( ) (OR)
[ ]
Since
⁄ ⁄ ⁄ ⁄ ⁄ ⁄
⁄ ⁄
( )
⁄ ⁄ ⁄ ⁄
( ) ( ) ( )
⁄ ⁄
⁄ ⁄
( )
⁄ ⁄ ⁄ ⁄
( )( )
PROVE THAT
Since therefore
⁄ ⁄ ⁄ ⁄
( )( )
( )
then
( )
√ √( )
√ √( ) √ ( )
. / . /. /
√
( )
√
. / . /
* + 0 1 [ ] [. / ]
√
( )
( )( )
( ) ( )
EXTRAPOLATION
The method of computing the values of „y‟ for a given value of „x‟ lying outside the table of
values of „x‟ is called Extrapolation.
REMEMBER THAT
also
NOTE: This method is used to accelerate convergence of sequence. i.e. sequence obtained from
iterative method.
INTERPOLATION
ERROR OF APPROXIMATION
The deviation of g(x) from f(x) i.e. |f(x) – g (x)| is called Error of Approximation.
REMARK: A function is said to interpolate a set of data points if it passes through those points.
INVERSE INTERPOLATION
Suppose on [a, b] and has non- zero „p‟ in [a, b]
Let be „n+1‟ distinct numbers in [a, b] with for each
.
To approximate „p‟ construct the interpolating polynomial of degree „n‟ on the nodes
“y0, y1...........yn” for
Since “yk=f (xk)” and f (p) =0, it follows that (yk) = Xk and p = (0).
OR for given the set of values of x and y , the process of finding the values of x for certain
values of y is called inverse interpolation.
Where
Where
REMARK
Sometime when a function is given as a data of some experiments in the form of tabular values
corresponding to the values of independent variable „X‟ then
1. Either we interpolate the data and obtain the function “f(x)” as a polynomial in „x‟ and
then differentiate according to the usual calculus formulas.
2. Or we use Numerical Differentiation which is easier to perform in case of Tabular form
of the data.
Given with Xi‟s distinct there exists one and only one Polynomial of degree
such that
PROOF
Existence Ok from construction.
For Uniqueness:
Assume we have two polynomials P(x), q(x) of degree n both interpolate the data i.e.
REMEMBER:
Using Newton‟s Forward difference interpolation formula we find the n-degree polynomial
which approximate the function in such a way that and agrees at „n+1‟ equally
Spaced „X‟ Values. So that
INTERPOLATION BY ITERATION:
Obtain a first approximation to „ ‟ by considering the first two points only i.e.
| |
| |
| |
And so on ………………
Then obtain a first approximation to „ ‟ by considering the first three points only i.e.
| |
X Y= f(x)
X Y= f(x)
300 2.4771
304 2.4829
305 2.4843
307 2.4871
X Y= f(x)
(OR) ( ) ( ) (OR)
TABLE
X Y
X Y
QUESTION: Construct forward difference Table for the following value of „X‟ and „Y‟
X y
0.1 0.003
0.064
0.3 0.067 0.017
0.081 0.002
0.5 0.148 0.019 0.001
0.100 0.003 0
0.7 0.248 0.022 0.001 0
0.122 0.004 0
0.9 0.370 0.026 0.001
0.148 0.005
1.1 0.518 0.031
0.179
1.3 0.697
= (OR)
(OR)
Where
DERIVATION:
Let
X : 10 20 30 40 50
f(x) : 46 66 81 93 101
SOLUTION: Here „15‟ nearest to starting point we use Newtown‟s Forward Difference
Interpolation.
* +
X 1 2 3 4 5 6 7 8
f(x) 1 8 27 64 125 216 343 512
SOLUTION
Since
Now
(polynomial of n-degree)
( ) ,
DERIVATION OF FORMULA
Let y=f (x) be a function which takes the values so we will obtain an
n-degree polynomial = 0 + +…………..+ n
Now
Put x= in (i)
Now Put x=
Similarly
+ +……………
Where
ALTERNATIVELY DEFINE
Then
Then
CONVERGENCE CRITERIA
Further assume that all nodes are contained in finite interval then for each „n‟ we
define ( )
(OR)
Lagrange‟s interpolation converges uniformly on [a, b] for on arbitrary triangular ret if nodes of
„f‟ is analytic in the circular disk „ ‟ centered at and having radius „r‟ sufficiently large.
So that holds.
𝑎 𝑏
PROVE THAT ∫
∫ ∫ ∫
∫ ∫ ∫
Now
∫ ∫ ∫
Let
∫ ∫ ∫
∫ ∫ ∫
∫ ∫
∫ ∫ ∫ ∫
[| | ] | |
( ) ( )
Elegant formula
Slow to compute, each is different
Not flexible; if one change a point xj , or add an additional point xn+1 one must
re-compute all
X: =1 =3 =4 =6
Y: -3 0 30 132
ANSWER: Since + + +
+ + +
[ ]
The 2nd Order Difference is [ ]
[ ] [ ]
Similarly [ ]
[ ] [ ]
If are arbitrarily Spaced (unequal spaced) Then the polynomial of degree „n‟ through
( ) ) where is given by the newton‟s Devided difference
Interpolation formula (Also known as Newton‟s General Interpolation formula) given by.
[ ] [ ]
[ ]
DERIVATION OF FORMULA
Let ……………..
Put
Put
Similarly
TABLE
X Y st
Order 2nd Order 3nd Order
EXAMPLE:
X Y
10
Then
Therefore
Thus the first difference of a polynomial of degree „n‟ is another polynomial of degree
Similarly
Hence The and higher order differences of a polynomial of degree „n‟ are zero.
This formula used only when the values of independent variable „x‟ are equally spaced. Also the
differences of „y‟ must ultimately become small. Its accuracy same as Lagrange‟s Formula but
has the advantage of being computationally economical in the sense that it involves less numbers
of Arithmetic Operations.
As we know that
Let
And
THEOREM:
( )
( ) ( )( )
( ) ( )( , - )
( ) ( )( , - )
( ) ( )( , - )
( ) ( )
( ) ( )
* ( ) + *( ) + * +
* + * + * +
* + * + * +
SPLINE
A function „S‟ is called a spline of degree „k‟ if it satisfied the following conditions.
( )
( )
( )
( )
NATURAL SPLINE
HERMIT INTERPOLATION
In Hermit interpolation we use the expansion involving not only the function values but also its
first derivative.
∑ ( ) ∑ ̂ ( )
Algorithm:
Make table
k
…. …… …… ……
….. …… …… ……
EXAMPLE
Estimate the value of using hermit interpolation formula from the following data
k
0 1.3 0.6200860 -0.5220232
1 1.6 0.4554022 -005698959
2 1.9 0.2810186 -0.5811571
and
and
and
[ ][ ] * +
* +
Similarly
* + and * +
Also ̂ [ ] * +
Similarly ̂ [ ] * +
And ̂ [ ] * +
∑ ( ) ∑̂ ( )
∑ ( ) ∑̂ ( )
̂
̂ ̂
EXAMPLE
Estimate the value of using hermit interpolation formula from the following data
X Y= =
1.00 1.00000 0.5000
1.10 1.04881 0.47673
Solution:
And and
We find
* ( ) +( ) ( ) * ( ) +( )
( )
NUMARICAL DIFFERENTIATION
The formula given as follows is known as forward difference formula if and backward
difference formula if
METHOD:
Write formula
Use values in given formula.
To find error bound write absolute value of less than to its answer. i.e.
| |
Compare actual value of given function at given point if needed and approximated value.
EXAMPLE:
SOLUTION:
* +
Therefore * +
* +
* +
* + After solving
* +
Since
Since
therefore * +
Now * +
* +
* +
* +
* +
Since
* + ( )
* +( )
* ( ) ( ) +
* ( ) +
Equation & are Newton‟s backward interpolation formulae which can be used to
st nd
compute 1 and 2 derivatives of a tabular function near the end of table similarly
Expression of Newton‟s forward interpolation formulae can be derived to compute the 1st, 2nd
and higher order derivatives near the beginning of table of values.
Since
Since therefore
Also as therefore ( )
( ) ( ) ( )
( ) ………..
( ) ( ) ( )
[ . / ]
* +
* +
* +
For calculating first and second derivative at an inter tabular form (point) we use (i) and (ii)
while 1st derivative can be computed by another convergent form for which can derived as
follows
Since * +
( )
We get * +* +
0 1
Therefore * +
Equation (ii) and (iii) are called STERLING FORMULAE for computing the derivative of a
tabular function. Equation (iii) can also be written as
* +
STERLING FORMULA
Sterling‟s formula is
( ) ( ) ( )
( ) * +
Where
DERIVATION:
…………(i)
…………(ii)
( ) ( ) ( )
( ) * +
Since
Similarly
Subtracting (i) and (iii) we get two point formulae for the first derivative
And
Similarly
By subtracting (iv) and (vi) we get three point formulae for computing the 2nd derivative.
NUMERICAL INTEGRATION
The process of producing a numerical value for the defining integral ∫ is called
Numerical Integration. Integration is the process of measuring the Area under a function plotted
on a graph. Numerical Integration is the study of how the numerical value of an integral can be
found.
Suppose f(x) is given for equidistant value of „x‟ say a=x0, x0+h,x0+2h …. x0+nh = b
Let the range of integration (a,b) is divided into „n‟ equal parts each of width „h‟ so that
“b-a=nh”.
By using fundamental theorem of numerical analysis It has been proved the general quadrature
formula which is as follows
* ( ) ( ) (
) +
Bu putting n into different values various formulae is used to solve numerical integration.
That are Trapezoidal Rule, Simpson‟s 1/3, Simpson‟s 3/8, Boole‟s, Weddle‟s etc.
Trapezoidal and Simpson‟s rules are limited to operating on a single interval. Of course, since
definite integrals are additive over subinterval, we can evaluate an integral by dividing the
interval up into several subintervals, applying the rule separately on each one and then totaling
up. This strategy is called Composite Numerical Integration.
TRAPEZOIDAL RULE
f(x2)
F(x0) F(x1)
f(x0)
h h
O a=x0 B=x1 X
O a= x0 x1 b= x2 X
For n = 3 ∫
The accuracy will be increase if number of trapezium will be increased OR step size will be
decreased mean number of step size will be increased.
∫ ∫ ∫ ∫
∫ * + * + * +
Therefore ∫ Where
SOLUTION
SIMPSON‟S RULE
REMARK
In Simpson Rule number of trapezium must of Even and number of points must of Odd.
Consider a curve bounded by x = a and x = b and let „c‟ is the mid-point between and such
that we have to find ∫ i.e. Area under the curve.
f(c )
f(a) f(b)
A B C
0 a c b X
Consider
Now
∫ ∫ * +
∫ ∫ * +
∫ | | * +
For n = 4
∫ ∫ ∫
In General
∫ ∫ ∫ ∫
EXAMPLE
SOLUTION
√ ∫
EXERCISE:
iii. Compute ∫ using Simpson‟s (1/3) Rule and also obtain the error bound by
taking
iv. Compute ∫ using Simpson‟s (1/3) Rule by dividing the interval of
integration into eight equal parts.
SIMPSON‟S RULE
DERIVATION
∫ ∫ ∫ ∫
REMARK: Global error in Simpson‟s (1/3) and (3/8) rule are of the same order but if we
consider the magnitude of error then Simpson (1/3) rule is superior to Simpson‟s (3/8) rule.
Simpson 1/3 Rule is sufficiently accurate method. It based on fitting 3 points with a quadratic. It
is best because it has low error than others. i.e. . The global error of Simpson 1/3
and 3/8 rule is same but if we consider the magnitude of error term we notice that Simpson 1/3
rule is superior than Simpson 3/8 rule.
ERROR TERMS
Rectangular Rule
Trapezoidal Rule
WEDDLE‟S
In this method “n” should be the multiple of 6. Rather function will not applicable. This method
also called sixth order closed Newton‟s cotes (or) the first step of Romberg integration.
First and last terms have no coefficients and other move with 5, then 1, then 6.
∫ [ ]
EXAMPLE: for ∫ at n = 6
BOOLE‟S RULE
The method approximate ∫ for „5‟ equally spaced values. Rule is given by George
Bool. Rule is given by following formula
SOLUTION
RECTANGULAR RULE
Rule is also known as Mid-Point Rule. And is defined as follows for „n + 1‟ points.
In general ∫ ∑
REMEMBER
As we increased „n‟ or decreased „h‟ the accuracy improved and the approximate solution
becomes closer and closer to the exact value.
If „n‟ is given, then use it. If „h‟ is given, then we can easily get „n‟.
If „n‟ is not given and only „points‟ are discussed, then „1‟ less that points will be „n‟. For
example, if „3‟ points are given then „n‟ will be „2‟.
If only table is given, then by counting the points we can tell about „n‟.one point will be
greater than „n‟ in table.
EXAMPLE
SOLUTION
Here a = 1, b = 3 then
X 1 3/2 2 5/2 3
F(x) 1 4/9 1/4 4/25 1/5
DOUBLE INTEGRATION
SOLUTION:
And
STEP – I:
STEP –I I:
STEP –III:
∫ ∫
⁄ ⁄
QUESTION: Evaluate ∫ ∫ √
And
STEP – I: √
Y/X 0
STEP –I I:
∫ ( ) ( ) ( ) * ( ) ( ) ( )+
∫ ( ) ( ) ( ) * ( ) ( ) ( )+
∫ ( ) ( ) ( ) * ( ) ( )
( )+
∫ ( ) ( ) ( ) * ( ) ( ) ( )+
⁄ ⁄
STEP –III: ∫ ∫ √
QUESTION: Evaluate ∬ where D is the square with comes at (1,1) , (2,1) ,(2,2) , (1,2)
Also
STEP – I:
STEP –III:
∫ ∫
Also
STEP – I:
STEP –I I:
∫
∫
∫
STEP –III:
∫ ∫
Method 1:
The two-point Gauss quadrature rule is an extension of the trapezoidal rule approximation where
the arguments of the function are not predetermined as a and b, but as unknowns x1 and x2. So in
the two-point Gauss quadrature rule, the integral is approximated as
∫ ≈ c1 f (x1) + c2 f (x2)
There are four unknowns x1, x2, c1 and c2. These are found by assuming that the formula gives
exact results for integrating a general third order polynomial,
.
Hence ∫ ∫
∫ | |
∫ * +
Since in Equation (iii), the constants a0, a1, a2, and a3 are arbitrary, the coefficients of a0, a1, a2,
and a3 are equal. This gives us four equations as follows
( )
( )
{( )
we can find that the above four simultaneous nonlinear equations have only one acceptable
solution
, , ( )( ) , ( )( )
√ √
Hence
∫ ≈ c1 f (x1) + c2 f (x2) *( )( ) + *( )( ) +
√ √
Method 2 : We can derive the same formula by assuming that the expression gives exact values
for the individual integrals of∫ ,∫ ,∫ , and ∫ The reason the formula can
also be derived using this method is that the linear combination of the above integrands is a
general third order polynomial given by .
∫
∫ ( )
∫ ( )
{∫ ( )
These four simultaneous nonlinear equations can be solved to give a single acceptable solution
, , ( )( ) , ( )( )
√ √
Since two points are chosen, it is called the two-point Gauss quadrature rule. Higher point
versions can also be developed.
HIGHER POINT GAUSS QUADRATURE FORMULAS
∫ ≈ c1 f (x1) + c2 f (x2) + c3 f (x3) is called the three-point Gauss quadrature rule. The
coefficients c1, c2 and c3, and the function arguments x1, x2 and x3 are calculated by assuming the
formula gives exact expressions for integrating a fifth order polynomial
∫
General n -point rules would approximate the integral
∫ ≈ c1 f (x1) + c2 f (x2) + . . . . . .. + cn f (xn )
EXAMPLE: Find Gauss 2 and 3 point formula for ∫ and compare with exact value.
Since
( ) ( )
Now ∫ ∫ ∫ ………….(i)
( ) ( ) ( )
∫ √ √
( )
∫
( )
∫ ∫ ∫
( ) .√ / ( ) . √ /
∫
( )
∫
( )
∫
( )
∫ ∫ ∫
Exact value: ∫ | | * +
Since
Also
( ) ( )
Now ∫ ∫ ∫ ∫ ………….(i)
( )
(√ ) ( √ )
( )
∫
√ √
( )
∫
( )
∫
∫ ∑ ∫ ∏ ∫ ∏
REMARK: Trapezoidal and Simpson‟s Rule Are Close Newton Cotes formulae while
Rectangular Rule is Open Newton Cotes formula.
And
Where
∫ ∫ ∑ ∫
∫ ∑ ∫ ∑ (∫ ) ∑ ∫
So
Now and
When
If x = b, 𝑥 = a
𝑥 𝑥
𝑝
𝑥 𝑥
𝑝
𝑏 𝑎
𝑛
n=p
As then and if
Using in we get
∫ ∫ ∫ ∫
∫ ∫ ∫ ∫
∫ ∫ ∫
∫ ∫ ∫ ∫
∫ | | | | | |
∫ As required.
Since ∫
And ∫
∫ ∫ ∫
| | ( )
∫ ∫ | |
∫ | | ( )
∫ ∫
| | ( )
Now for n = 3
∫ ∑
DIFFERENTIAL EQUATIONS
DIFFERENCE EQUATION
Equation involving differences is called Difference Equation.
OR an equation that consist of an independent variable „t‟, a dependent variable „y(t)‟ and one or
more several differences of the dependent variable as is called difference
equation.
The functional relationship of the difference equation is
Solution of differential equation will be sequence of values for which the equation is true for
some set of consecutive integer „t‟.
Importance: difference equation plays an important role in problem where there is a quantity „y‟
that depends on a continuous independent variable „t‟
In polynomial dynamics, modeling the rate of change of the population or modeling the growth
rate yields a differential equation for the population „y‟ as the function of time „t‟
i.e.
In differential equation models, usually the population is assumed to vary continuously I time.
Difference equation model arise when the population is modeled only at certain discrete time.
DIFFERENCE OF A POLYNOMIAL
The “nth” difference of a polynomial of degree „n‟ is constant, when the values of the
independent variable are given at equal intervals.
EXAMPLES:
i.
ii.
The highest derivative involved in the equation determines the order of Differential Equation and
the power of highest derivative in Differential Eq. is called degree of D.E. for example
Order of differential equation is the difference between the largest and smallest argument „t‟
appearing in it.
For example; if then
It is the solution which contains as many arbitrary constants as the order of differential equation.
e.g. Is a 2nd order Differential Eq. with constant co-efficient and general solution is
PARTICULAR SOLUTION: Solution which can be obtained from General Solution by giving
different values to the arbitrary constants in
For example
SINGULAR SOLUTION: Solution which cannot be obtained from General Solution by giving
different values to the arbitrary constants.
If all the conditions are given at the same value of the independent variable, then they are called
Initial conditions. If the conditions are given at the end points of the independent variable, then
they are called Boundary conditions.
INITIAL VALUE PROBLEM: An initial value problem for a first order Ordinary Differential
Equation is the equation together with an initial condition on a specific interval
Such that
There exist constants and such that for any with whenever
is continuous with ⌈ ⌉ and when the initial value problem
has a unique solution that satisfies
Suppose that be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
Let be the roots of equation (ii) then for these values there corresponds two solutions,
which are given by
or
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
So
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
√ √
i.e.
or in general.
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
let
where √ and ( )
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
and ( ) also ( )
) (√ )
EXAMPLE :
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
-1 1 1 -1 -1
-1 0 1
1 0 -1 0
EXAMPLE :
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
So ( )
( ) ………..(iv)
then
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
( ) ( )
where √ √ ( ) √ also √ √ ( ) √
and ( ) . /
also ( ) . /
EXAMPLE :
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
- 1 -6 14 -14 5
1 1 -5 9 -5
1 -5 9 -5 0
1 -4 5
1 1 -4 5 0
using quadratic formula.
where √ √ √ also √ √ √
and ( ) ( ) also ( ) ( )
EXAMPLE :
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
-1 1 6 11 6
-1 -5 -6
1 5 6 0
………..(iv)
………..(v)
Eq (vi) – Eq (vii)
EXERCISE:
i.
ii.
If is the solution of nth order homogeneous difference equation and is the solution of non
– homogeneous linear difference equation then where is also called
complimentary function and is particular integral.
TYPE I : When R.H.S of given non – homogeneous difference equation is constants. i.e.
then to find put and then evaluate the value of A.
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
So
To find particular integral. Let
Now general solution is
EXAMPLE :
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
So
(after solving)
Thus
Now general solution is
TYPE II : When R.H.S of given non – homogeneous difference equation has the form as
where are constants then to find put and then evaluate
the value of A.
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
EXAMPLE :
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
where √ √ √
and ( ) ( )
( )√
EXAMPLE :
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
(after solving)
Thus
Now general solution is
EXAMPLE :
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
where √ √ √ and ( ) ( )
. ( ( )) ( ( ))/
(after solving)
Thus
Now general solution is
. ( ( )) ( ( ))/
EXAMPLE :
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
factorizing. So
(after solving)
Thus
Now general solution is
TYPE III : When R.H.S of given non – homogeneous difference equation is a polynomial i.e
etc. then to find
put ……….. upto the highest power of „k‟ defined in the
difference equation and the evaluate the values of ……………..
EXAMPLE :
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
So
i.
ii.
iii.
TYPE IV : When R.H.S of given non – homogeneous difference equation has the form as
where is a polynomial in „k‟ then to find
put ……….. upto the highest power of „k‟
defined in the difference equation and the evaluate the values of ……………..
EXAMPLE :
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
So
[
]
[
]
[
]
i.
ii.
iii.
iv.
TYPE V : When R.H.S of given non – homogeneous difference equation has the form as
where are constants then to find
put or then evaluate the values of
……………..
EXAMPLE :
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
So
……………….(iii)
……………….(iv)
Let and
and
then and
Then
Where and
i.
ii.
iii.
TYPE VI : When R.H.S of given non – homogeneous difference equation has the form as
where are constants then to find
put or then evaluate the
values of ……………..
EXAMPLE :
SOLUTION : Given
Let be the non – trivial solution of (i) then it must satisfies the eq (i) i.e.
√
using quadratic formula.
√ √
So ( ) ( )
[
]
……………….(iii)
……………….(iv)
Let and
then and
Then ( )
Now general solution is
√ √
( ) ( ) ( )
Where and
i.
ii.
iii.
iv.
STIFF DIGFFERENTIAL EQUATIONS: Those equations whose exact solutions has a term
of the form where c is a large positive constant.
REGION OF ABSOLUTE STABILITY: Region R of absolute stability for a one step method
is and for a multistep method it is
SINGLE STEP METHODS: A series for „y‟ in terms of power of „x‟ form which the value of
„y‟ at a particular value of „x‟ can be obtained by direct substitution
e.g. Taylor‟s, Picard‟s, Euler‟s, Modified Euler‟s Method.
MULTI – STEP METHODS: In multi-step methods, the solution at any point „x‟ is obtained
using the solution at a number of previous points.
(Predictor- corrector method, Adam‟s Moulton Method, Adam‟s Bash forth Method)
REMARK: There are some ODE that cannot be solved using the standard methods. In such
situations we apply numerical methods. These methods yield the solutions in one of two forms.
(i) A series for „y‟ in terms of powers of „x‟ from which the value of „y‟ can be obtained
by direct substitution. e.g. Taylor‟s and Picard‟s method
(ii) A set of tabulated values of „x‟ and „y‟. e.g. and Euler‟s, Runge Kutta
If
DISADVANTAGE: Need to explicit form of the derivatives of function. That is why not
practical.
CONVERGENCE
A Taylor‟s series converges rapidly if „x‟ is nears „c‟ and slowly (or not at all) if „x‟ is for away
form „c‟.
SOLUTION
[ ]
where
therefore , , , ,...........................
QUESTION: Explain Taylor Series method for solving an initial value problem described by
SOLUTION: Here we assume that f(x,y) is sufficiently differentiable with respect to „x‟ and „y‟
If y(x) is exact solution of (i) we can expand by Taylor Series about the point and obtain
Since the solution is not known, the derivatives in the above expansion are known explicitly.
However „f‟ is assume to be sufficiently differentiable and therefore the derivatives can be
obtained directly from the given differentiable equation itself. Noting that „f‟ is an implicit
function of „y‟ . we have
( )
Now
( )
[ ]
Continuing in this manner we can express any derivative of „y‟ in term of and its partial
derivatives.
EULER‟S METHOD
To find the solution of the given Differential Equation in the form of a recurrence relation
( ) Is called Euler Method
FORMULA DERIVATION
Given That ( ) ( ) ( )
Similarly
In this method we use the property that in a small interval, a curve is nearly a Straight Line. Thus
at We approximate the Curve by a tangent at that point.
The object of Euler‟s Method is to obtain approximations to the well posed initial value problem
GEOMETRICAL INTERPRETATION
Geometrically, this method has a very simple meaning. The desired function curve is
approximated by a polygon train. Where the direction of each part is determined by the value of
the function at its starting point
There is too much inertia in Euler Method. One should not follow the same initial slope over the
whole interval of length “h”.
The advantage of Euler‟s method is that it requires only one slope evaluation and is simple to
apply, especially for discretely sampled (experimental) data points. The disadvantage is that
errors accumulate during successive iterations and the results are not very accurate.
SOLUTION: where
Then
as required.
* ( ) ( )+
Method also known as Improved Euler method sometime known as Runge Kutta method of
order 2
( )
* ( ) ( )+
* ( ) ( )+
* ( )+
* ( )+
Basic idea of Runge Kutta Methods can be explained by using Modified Euler‟s Method by
Equation
Here we find the slope not only at „ ‟ but also at several other interior points and take the
weighted average of these slopes and add to „ „ to get „ ‟.
ALSO RK-Approach is to aim for the desirable features for the Taylor Series method but with
the replacement of the requirement for the evaluation of the higher order derivatives with the
requirement to evaluate at some points with in the steps to „ ‟
IMPORTANCE: Quite Accurate, Stable and easy to program but requires four slopes evaluation
at four different points of (x,y): these slope evaluations are not possible for discretely sampled
data points, because we have is what is given to us and we do not get to choose at will where to
evaluate slopes. These methods do not demand prior computation of higher derivatives of
as in Taylor Series Method. Easy for automatic Error control. Global and local errors have
same order in it.
Taylor Series needs to explicit form of derivative of but in RK-method this is not in
demand. RK-method very extensively used.
i.e.
Also denote
,, ,,
IN ANOTHER WAY:
If
Where ( )
LTE in RK-method is the error that arises in each step simply because of the truncated Taylor
series. This error is inevitable. Error of Runge Kutta method of order two involves an error of
O .
Where
………………….….. (
∑ )
EXAMPLE:
SOLUTION:
If „h‟ is not given then use by own choice for 4 – step take h=0.1 and for 1 – step take h=0.4
Where ( )
( )
For n = 0; ( ) 𝑥 𝑥
𝑛
n = 2 steps
For n = 1; ( )
i.e.
Also denote
,, ( )
( )
Then
Is the formula for Runge Kutta method of order four and its error is
ADVANTAGE OF METHOD
The main computational effort in applying the Runge Kutta method is the evaluation of . In
RK – 2 the cost is two function evaluation per step. In RK – 4 require four evaluations per step.
EXAMPLE:
SOLUTION:
Where , ( ) , ( )
, ( )
( )
, ( )
( )
, ( )
( )
A predictor corrector method refers to the use of the predictor equation with one subsequent
application of the corrector equation and the values so obtained are the final solution at the grid
point.
PREDICTOR FORMULA: The explicit (open) formula used to predict approximation is
called a predictor formula.
CORRECTOR FORMULA: The implicit (closed) formula used to determine is called
Corrector Formula. This used to improve
IN GENERAL: Explicit and Implicit formula are used as pair of formulas. The explicit formula
is called „predictor‟ and implicit formula is called „corrector‟
Implicit methods are often used as „corrector‟ and Explicit methods are used as „predictor‟
in predictor-corrector method. why?
Because the corresponding Local Truncation Error formula is smaller for implicit method on the
other hand the implicit methods has the inherent difficulty that extra processing is necessary to
evaluate implicit part.
REMARK
Why Should one bother using the predictor corrector method When the Single step method
are of the comparable accuracy to the predictor corrector methods are of the same order?
A practical answer to that relies in the actual number of functional evaluations. For example, RK
- Method of order four, each step requires four evaluations where the Adams Moulton method of
the same order requires only as few as two evaluations. For this reason, predictor corrector
formulas are in General considerably more accurate and faster than single step methods.
REMEMBER: In predictor corrector method if values of against the values
of are given the we use symbol predictor corrector method and in this method
we use given values of
If Are not given against the values of then we first find
values of by using RK - method
OR By using formula
MILNE‟S METHOD
It‟s a multi-step method. In General, Milne‟s Predictor – Corrector pair can be written as
P:
C:
ALGORITHM
First predict the value of by above predictor formula.
Where derivatives are computed using the given differential equation itself.
Using the predicted value we calculate the derivative from the given
differential Equation.
Then use the corrector formula given above for corrected value of . Repeat this
process.
SOLUTION:
P:
The predictor – corrector formulas for Adam‟s Moulton method are given as follows
REMARK
For m=0
Also in easy way we can find by using Euler‟s method with some error as follows
Now by using Euler‟s method
now as