Numerical Differential
Numerical Differential
NUMERICAL DIFFERENTIATION
derivative of a function
1.1 Introduction
approximate numericalvalue of the corresponding tothe
The process of
evaluating the
given set of values y, y, ; For, this purpose we first
at some vaalue of x by using the the numerical
differentiation.
differentiate it as many
"=fr) called and then
interpolating polynomial
...... X, is
arguments a suitable
approximate the function by
desire.
tÉmes as we difference formula
using the forward derivative of
Numerical differentiation equally spaced and the
1.2 ofx) are Newton's
values (ie., the values
argument values, we employ
tabular
When the given point in the beginning ofa set of
required at a
the function is formula (NFIF)
forward interpolation
=fu) + Af6)
ie., f(y) =f,+ rh)
2!
r-r-&f()3!
rr-r-2Xr-3
4!
sf()
rr-)r-2)r-3)(-4) sf(r)
S!
required to
getvalues
+
(6r-75r
(5r-40r+105r-100r24) +(4r'-18r (6r-75r
(5r*-40r+105r*-100r
24) (4'
+-18r f( the
formula +22r-6) -6r+2)(3r² +2r-0F() (ar-6r+f() value x).
of
24
6
24
6
+rh) (,=X,
of
for
+340r-675r
the 120
+340r-675r 120 h=0+ the
'f() derivative
derivative 720 720 +
4f(4)+ rh)
and
of h UG
of+548r- +548r 2 (r) f
is
Mathematics
fx) 4f() the
f() atstep-size
at 120) 120) - x
x f) =
= 4f(*.Jt.. x,
x,6f(%)
+... we (ie., -VI
+rh differentiate
the (by
difference Dr.
Mahantesh
the
equation between
S.
(2-)- Swamy)
(1) two
Special
and W.r.t.(2) r.
Dlfferentiation
Numerlcal
(3), ie.,the Thisdy Thus, Now
reprsents
case:
so
r() = that value et
to
|o
they the
get of
become. secondthe
value
value
d'y ’f"() of
order second
of or
f' order
-36r(+22)12r.(orzó)
derivative
andf" =
-150r+510F²
-675r+274)(15r(10r-60r
+105r
-50) (30-(20r-120r
+210r
-100) f"z, derivative
x=I,+rh
(6r-18r+11) 6
at 300r 24
the off 12 s() +rh)
120
initial ()
at 360
60
+1020r-1350r+
720
h=0+A'f) off)
--
--(4 (2) (3)
ation
Solution: Example 4
We
and(3) ’
have, 5 4 3 2 1
h=l forwar:
The
Evaluate
l:
fs)-d)s)rs)
2 6
and 1g
-27.9 y'(0)
y'(0) = 0)y= dfference y(0)
a,
4 0
= 0 and"(0}
4 -8 47 4 Ay EXAMPLES
VIOKKED
table
1.5 1
is from
6- UG
7 -1S ABy
15 2 the Mathermatlcs
10
- data
14.4
-10 22 -18 A'y 7 3 :
-VI
6 4 (by
-32 40 A'y Dr.
Mahantsh
2 5
72 4y
S.
Swamy)
(-5)-
Example Differentiation
Numerical
Solution:
Also,
The Take To fx)
have,We
1.8 1.6 1.4 1.2 forward findf'
x, (1.)
Here 2:
=l.l=x, Find
x,
= f(1.1)
difference 0 1
fr) =
y = 1,
2,432 1.296 0.544 0.128
+
\ dy h= y"0) . y"(0) =
rh 0.2. 0.128 and
table 1.2 = =
f"(1.1) 1
117.67 3+
is1.l=1
0.752 0.416 0.128 18+36.67
1.136 using
1.568
+
0.544 1.4 -t
the
0.2) +
table 60 11
2.0
4
0 5
Numerical Differentiation
6 UG Mathematics - VI (by Dr. Mahantesh S. Swamy)
44
- 02
Jo284P05)-o28),R0.5) -05)+20048)
2 6 1.0 2.72
0.60
3.32 0.14
1.2 0.02
0.74
0128+0-0.002] 1.4 4.06 0.16
0.03
0.01
0.02
0.90 0.03 -0.07
1.6 4.96 0.19
=f(|.l) = 0.63 1.09 0.06 -0.05
dxr=l 1.8 6.05
1.34
0.25 -0.02
0.04
7.39 0.29
Also, 2.0
dr = 1.63
2.2 9.02
dy
- (02)10.288 +(0.5-1) (0.049))
0.264 = 3.3125
=6.6
0.04
f"(1)= 6.6 and
--- (1)
dy
and f"(%) =|3 -- (2)
180
Here h = 0.2 and I,= 1.2.
To get Ay, A'Y . . we construct the forward difference table.
Numerical Differentiation
UGMathematics - VI (by Dr. Mahantesh S. Swamy)
EXERCISE r(r+)r+2)\7+9) y'sle.)
4!
r(r+1Xr +2)(r+3\/+4)
5!
q:f(z,)
1. Find y' and y" at x= 1, given that
1.05 1.10 1.15 1.20 1.25 1.30
1.140
rr+1\r+ 2\r+ 3)\r+4Xr+5f)+
6!
....
--- (1)
1.0247 1.0488 | 1.0723 1.0954 1.1180
1
(An:0.494, 0.2739)
Here r= (:%, = x, +rh) and h is the difference between two consecutive
that h
2. Find the second order derivative at x=3, given
.06 values of x.
2.98 3.00 3.02 304 w.ri. r
2.94 2.96
Now, to get f and f" at x we differentiate equation (1)
fw): 0.1826 0.1797 0.1783 0.1769 0.1755 ol1742
0.1811
(Ans :-0.25) fa) = f(, +rh) ih =0+ Vf(,)+ (2r+) f(s.)
2
12
Here h 0.1 and x =0.4
(10r+60r +105r+s°s sly ) dy
60 We have
= 0,4488
y(0.203) = 0.4488
we Also,
(or'.
12
2)
*%)+rsf(a)+ 2!
3! 16
KOLAPTER (By Newton'ssforward interpolation formula)
=h to t ray, 2.5 Simp
r=0l By tak
NUMERICAL INTEGRATION W
I=
2.1 Introduction
The process of finding the value of adefinite integral, say/=f() di using the given set of
l= 2.6 W
values of the integrandfx) corresponding to the valuesx , , , ofx, is known as numerical
By
integration. When the integrand is a single valued function of xthen the numerical integration is 3n in3--3n? --2n5. 35n 50,3-+12n° 4'
also refered to as quadrature. Now we shall derive some simple quadrature formulae and use 4 3 5!
them to evaluate the definite integrals. 6
Since xis arbitrary, choose x =X,+ rh, where r is any real number Half of interval of differencing x {(sum of first and last terms)
dx = h. dr +2 (sum of all the intermediate terms)
When x=, ’ r=0and when x=X, tnh ’ r= n. Then
2.4 Simpson's One-third Rule
() = l= Jf(ig+ rh)- h-dr
r=0 By taking =2 in the general quadrature formula (2) and neglecting the terms with 4'y
A'y...,. we get
=h
r=0
Exa
15
Numerical Intogration
UG Mathematics - VI (by Dr. Mahatesh S. SwAmy) 17
16 Solution: Herex, 0 and x, = 1.
= one-third the interval of differencing x {(sum of first anl last terms) Dividing the interval [0, | into 8equal parts rneanstaking n=8.
+ 4(sum of odd numbered terms) + 2(sum of even nunbered terms)}
ormula) =0+8h ’ h= h= 0.125
Since x, = x, t nh ’
2.5 Simpson's Three-eight Rule x, =X,+ h=0+0.125 ; x,= , + 2h =0+210.125) = 0.25 and so on
neglecting the erms with Ay.
Ry taking n=3 in the general quadrature formula (2) and 1
A' . we get, Also, since the integrand is y = f (x)= 1+x we have y, = fo, = 140 =,and so on
I= (r) dt =+,)+2(7, +%, +y, +...).+ 3();+, +y,+yt...)] 0.25 0.375 0.5 0.625 0.75
0.125 0.875
= Three-eighth the interval gf differencing x {(sum of firs and last terms) 0.8 0.727 0.667 0.615 0571 0.533
+ 2(sum of tems with superscrips multiples of 3) y=x) 0.889 0.5
+ 3(sum of the remaining ter1ns) }
Yo
The trapezoidal rule is
2.6 Weddle's Rule
h
neglecting the erms with Ay [(y, +y) + 2(y, + y, +y, + y, +y, + ), + -)
By taking n =6in the general quadrature formula (2) and
..... we get.
--- (2)
dx 0.125 (1+0.5) +2(0.889 +0.8+0.727 +0.667 -0.615 -0.571 -0.533)|
"2
muja.
= 0.694 -.- (1)
3 +y,) + ...]
10
I0, + 5y, +y, + 6y, + , + 5v, +y)+ (9, +5y, +y + 6v, + , +,
as and Note : Ineach formulae the upper limitx stands for x,+ nh, where
n is number o subintervals of We know that -[log(1 + )]
0.694 = log (1 + 1) - log (1 +0) (by (
To apply 0.694 = log 2-0
even number of sublhtervals i.e., the
" Simpson's i/3 rule n must be even (i.e., there should be
log 2 = 0.694
subscriptof last symbol (i.e.,y. )must be even).
y) must
"Simpson's 3/8 rule n must be a multiple of 3 (i.e., the subscript of last symbl (i.e., 3
choosing h = 1.
Example 2: Evaluatedx by trapezoidal rule by
erms)
ms) } be a multiple of 3).
"Weddie's rule n must be a multiple of 6. (i.e., the subscript of last symbol (i.. y)must be a
-3
multiple of 6, i.e., there should be atleast seven consecutive valuesof y). Solution: Here, y =fx)= *
X, =-3 y, =f-3) = (-3) = 8l
WORKED EXAMPLES x, =X, +h=-3+1=-2 ,=f-2) = l6
=A-l) 1
X,= X,+h=-2+ 1 =-1 ,=A0) =0
dx
Exanmple 1: Evaluateby Trapezoidal rule by considering eight sabintervals of X, =X, +h=-l+1 =0
I, =,+h=0+ 1=1 Y,=A2) = 16
[0, 1]. Hence find an approximate value of log2. X,F A, +h=1+1=2 y,=f3)= 81
X, =X, +h=2+|=3
Solution: Example
Here.
Solution: Example 18
The Also,
I, Given 4: ,
I, 1 =0
}=I,=I,+
=x, h=0+ =0.399.y,=0.352,
Simpson's The
4, in Use Here. 3:
I,= h= the
Simpson's
Trapezoidal
+
+h=2+]
h=3+1= + l, step x, fu) By
h= =
0. Simpson's
y=f) 1/3d
1+l of Sr) rule 0.5,x,
=0.399 rule
1
=2 = unit. 1/3rd da 0.5 is y, is
4 3 =
(l+x rule
=(0.399 h=-=0.5-0=
30.5 =I6,
=
0.242, x,
13rd
=0.352 0.5 rule
to 0.453 y, 1, 1, =(S1
evaluate =
Y,=(4)
=0.04
=0.0625
y,=3),=f2)0.111 = Y,
Y%=0) = + +
+ 0.129, 1.5, =evaluatefr) +
=f1)
1.924 0.054) )+ 0.242
81) UG
40, y, ,=
I
0
+ Mathematics
(1+x)? + = 2(16
1)+
= dr0.484] + 0.054. 2.0.129
0.25 4(0.352 1.5 +1
(1+0)² =1 dx +0+1
correct
0.4768
=
+
20°J) + 0.054
given -
0.129) 2 VI
that, + (by
to 16)] Dr.
3 +
places 2(0.242)| 115 = Mahantesh
of
decimal S.
Swamy)
Example
TheX,=, giSolvenution: We 20
I,=X, X,=X I=, X,=A, I, x, Here PRmple
7: 3/8h =X,+ =, =X, by
=* the
Evaluate +h=2.6+ +h=
+h=2+0.2 +h= + + + x, 6:
0.5440
0.4771 | rule
h=2.4+ + h=
h= = definiteeknow
3 h=1.6 h=l+0.2 1 the
By
2.8 is, 2.2 1.4 1.2 1.8 curve
3 + + + + + integral that using
3.5 0.2 0.2 0.2 0.2 0.2 0.2 0.2
y. = = = = = = = = = y
dx 2.8 2.6 2.4 2.2 2 1.8 1.6 I.4 1.2
area Simpson'
= s
= =
using 0.9152 0.075 under x'+1x'-1
0.6020 3(0.2) 3h 2.8/,.2
Weddle's [0.7738 thbetween
e
+ [o, 3/8th
is (0+0.7738)
3(0.1803 curve
0.6532 the + rule
4.5 y) Y,=f(2.8) UG
+ 0.7738 =V=f2.2)
required Y,
V,=f2.4)
0.7041 =',=f1.8)
=0.6575 ; ),=fl.4)
0.5283 =0.3243
y, = V, y the with
=Í2) =f(1.6)Y,=f1.2)
=0.1803
rule + Mathematics
2.1914 20, =f(2.6) = =fr)
0.6996 +0.3243 fr) ordinates h
5.0 from + + = between =
area + 2(0.4382 y) = 0.6 = = 0.2,
9.2379] 0.7423 0.4382 0
the +0.5283 + x=1and findthe -
0.7404 3, the VI
5.5 following (bó
+ + ordinates
0.6575) approxinnate
under
area Dr.
+0.6+ y,
+ t=Mahantesh
0.7782
6.0 data ),+ x 2|8.
0.7041 and=,#, is
+), S.
+ + Swamy)
0.7423)) (-1)-
y))
Example Integration
Numerical
Solution:
and6). for Solution:
From
Weddle's
Now, ,
W.k.t =
3
the Here
to 0, Here 8:
Weddle'h=3.5
s
ruleapply , Evaluate
(iii)
Ih=z =1 y =
*y ,=X, h= X, o=0 n =
Sinmpson'
fr) s 0.15 3(0.105) 10 3h
+ = must
1Simpson's
y, rulc, 3=
= X, = [12.898 [O.4771
X, be + we0.5
+ , 5y,
+h
=
h=
6 2
multiple
1/3rd nh=1
t
1+: 3/8th
1)]= +
t
have,
6 6 4 6 3
5(0.5440)
y,
6 5 +
of
rulen rule by 1.9347 6y,
=
6.
(iv)
using +
Thus must
0+ +0.6020+6(0.6532) y,
Weddle's (1) +
n=6 be nh 5y,
= Trapzoidal +
even, 1
1s y
a rule.
’ proper for
3/8th
rule +
,=0)=0 choice(· rule 0.6996+
du
= 3/8h
0.346575 0.346656 = dt 1/3rd
3(1/6)
10 34 rule
0.346611 = dx
3(16)8 =[(0+
R3h 1/6 =;l0,
rule =
[0+
[(0+
l0,+) I/6
5(0.J622) l(0+
0.5)
+
0.5) y)+ 0.5)
+
+ 2(0.4)
+ 2(0;) 4(0. 40, + 2(0.1622
+
0.3 + 1622 + UG
4 + 3(, y,
60.4) 3(0.1622 + + Mathematics
+ 0.4 y)+ +
y, + 0.3+
+0.4615 + 2(,
+0.3+0,4615 y, 0.4918)+ 0.4
+ + -
y,)) y,)) 0.4615
+
VI
5(04918) + 2(0.3 (by
+ Dr.
+ 0.4918)] Mahantoslh
0,49
+ 0.4615)|
+0.5)
18)] =
0.3442 S.
Swamy)
9. 8, 7. 6. 5.Eraluate 4. 3. 2. Numerlcal
Evaluate Using Evaluate Evaluate Evaluate ruleEvaluate,
Using ruleEvaluate
,
Sinpson' s Trabezoidal (iv) (iv)
l4 Integration
0.199 0.2 y 0.146 Weddle' s log eddle' s
dx (*) V2x-x* dx
e
1+:7 dx
using dX by x
1/3 by dx
0.389 0.4
rule by Simpson'sTrapczoidal rule. by rule. by
Weddle's rule 0.161 0.9589
L.0000
0.9896 using dx using
evaluatey by using
evaluate Simpson's Simpson's (i)
(i)
1/3d
rule Trapezoidal Trapezoidal
0.565 0.176 0,25
0.6 rule 2 )
for 4r+5*
dx rule. by EXERCISE
dx 0.190 for 1/3rd 3/8 choosing
0.717 0.8 the 0.50
0.75
1.00
rule,
3 the rule.
data, rule rule,
data (Ans: (i1)
0.204 0.8415
0.9089 for h= (1)
0.841
1.0 4 the Simpson's 1A108
0.2. 1.82765 Simpson'
(Ans : s
following
0.932 0.217 ; 1/3rd
1.2 1.32734; 1/3rd
3;1.3662;1.3571;
data rule,
0.230
rale,
0.985 : (iii)
1.4 6 1.32784; (in)
:0.14671)
(Ans (Ans: Sinpson's
(Ans:
1.388) Simnsorsa~
(Ans:0.8072) 1.61) : 1.136)
(Ans (Ans:
1.72197) 1.827241 ;13135)
3Ieth
AL
PicatBy
No Ar