0% found this document useful (0 votes)
41 views15 pages

EEE 231 Lecture

Uploaded by

raiseman499
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views15 pages

EEE 231 Lecture

Uploaded by

raiseman499
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

EEE 231 lecture notes

On

Numerical solutions to equations


&
Integral functions
NUMERICAL SOLUTION OF EQUATIONS

Given a function f(x), it required to find the root of the equation using numerical

methods.seveeral Numerical methods can be used to solve these equations which includes:

1. Bisection method

2. Regula falsi or method of linear interplation

3. Newton’s method

1. Bisection method

Given f(x) = 0 and values of x 1and x 2 such that f (x ¿¿ 1)¿ and f (x ¿¿ 2)¿ are of opposite sign

and that f(x) is continous between x 1and x 2

Set of Rules

1
|x −x | ≥ tolenrance value
2 1 2

( x 1 + x 2)
Set x 3 =
2

If f (x ¿¿ 3)¿ is of opposite sign to f (x ¿¿ 1)¿

Set x 2= x 3 else Set x 1= x 3

Example 1: find the roots of the equation between 3 and 4, if f(x) = x 2−3.7 x=0 using

bisection method. Tolerance value = 0.03


Solution

f(x) = x 2−3.7 x=0

x 1=3 , x2 =4 ,

No of
x1 x2 x3 f (x ¿¿ 1)¿ f (x ¿¿ 2)¿ f (x ¿¿ 3)¿
iteration
1 3 4 3.5 -2.100 1.200 -0.700

2 3.5 4 3.75 -0.700 1.200 0.188

3 3.5 3.75 3.625 -0.700 0.188 -0.272

4 3.625 3.75 3.6875 -0.272 0.188 -0.046

5 3.6875 3.75 3.71875 -0.046 0.188 0.070

6 3.6875 3.71875 3.703125 -0.046 0.070 0.012

x=3.703125 ,since f (x ¿¿ 3)¿ @ 6 is less than 0.03 (0.012< 0.03).


x
Example 2: find the roots of the equation between 1 and 3, if f(x) = e 2 −¿ using bisection

method. Tolerance value = 0.2

Solution

No of
x1 x2 x3 f (x ¿¿ 1)¿ f (x ¿¿ 2)¿ f (x ¿¿ 3)¿
iteration
1 1 3 2 -2.3513 4.0372 1.7183

2 1 2 1.5 -2.3513 1.7183 0.3392

3 1 1.5 1.25 -2.3513 0.3392 -0.6918

4 1.25 1.5 1.375 -0.6918 0.3392 -0.1270

5 1.375 1.5 1.4375 -0.1270 0.3392 0.1161

x=1.4375 ,since f (x ¿¿ 3)¿ @ 5 is less than 0.2 (0.1161< 0.2).


2. Regula Falsi or Method Of Linear Interpolation

Given f(x) = 0 and values of x 1and x 2 such that f (x ¿¿ 1)¿ and f (x ¿¿ 2)¿ are of opposite sign

and that f(x) is continous between x 1and x 2

Set of Rules

|x 1−x 2| ≥ tolenrance value 1 or


|f ( x 3)| ≥ tolenrance value 2
(x 2−x 1)
Set x 3 = x 2 - f (x ¿¿ 2)¿
f (x ¿¿ 2)−f (x ¿¿ 1)¿ ¿

If f (x ¿¿ 3)¿ is of opposite sign to f (x ¿¿ 1)¿

Set x 2= x 3 else Set x 1= x 3

Example 3: find the roots of the equation f ( x )=3 x + sinx−e x =0

Solution

When x = 0, f(0) = -1 i.e. < 0

x = 1, f(0) = 1.1232 i.e. < 0

Iteration x1 x2 x3 f (x ¿¿ 1)¿ f (x ¿¿ 2)¿ f (x ¿¿ 3)¿


number
1
0 1 0.470990 -1 1.123189 0.265160

2 0 0.470990 0.372277 -1 0.265160 0.029533

3 0 0.372277 0.361598 -1 0.029533 0.00294

4 0 0.361598 0.360538 -1 0.00294 0.000291

5 0 0.360538 0.360433 -1 0.000291 0.000028

X= 0.360433.
3. NEWTON’S METHOD.
Given a function f(x) = 0 and a value of x vary close to the root, a specific no of iteration or a
tolerance value.

Steps

Set of rules

|x 1−x 2| ≥ Tolerance value 1 or


f ( x 2 ) ≥ Tolerance value2 ,∨f ( x ) ≠ 0

f ( x1)
( x 2 )=x 1−
f ' ( x1 )

x 1=x 2

Example 4: find the solution of the equation f ( x )=2 x 3−7 x 2−x +12=0 which as a root near

x= 1.5

Solution
3 2
f ( x n ) =2 x −7 x −x +12
2
f ' ( x n ) =6 x −14 x−1

Iteration
number

0 1.5 1.5 -8.5

1.6764705
1 0.07327498 -7.60726644
9
1.6861028
2 0.00028558 -7.54778314
2
1.6861406
3 4.462E-09 -7.54754728
6
1.6861406
4 0 -7.54754728
6

Example 5: find the solution of the equation f ( x )=x 3 +5 x 2−3 x−4=0 which as a root near

x= 0.5
Solution
3 2
f ( x n ) =x +5 x −3 x−4
'( xn )
f =2 x 2 +10 x−3

Iteration
number

0 0.5 -4.125 2.5

1 2.15 -2.63075 -3.365

-
2 1.36820208 2.65044486
8.92296753
-
3 1.66523834 0.1591048
7.67522441
-
4 1.685968 0.00130329
7.54862344

Example 6: find the solution of the equation f ( x )=e x + x−2=0 which as a root near

x= 0.4

Solution
x
f ( x )=e + x−2=0
'( xn )
f =e x +1

Iteration
number

0 0.4 -0.1081753 2.4918247

10.354650
1 0.44341208 -6.02808352
3
-
2 2.16114712 2.6675241 -3.2327184
7
2.9391256
3 1.33598271 -8.99465913
2
0.1782515
4 1.66274614 -7.69009763
4
INTEGRAL FUNCTIONS
Some functions are mostly convieniet defined in the form of as integrals and we shall look
into different appraoch which include Gamma and Beta functions in this module.

1. The Gamma functions


The functions r(x) is defined by the integral

r(x) = ∫ t
x−1 −t
e dt and is convergent for x > 0 (1)
0

∞ ∞

from (1) r(x+1) = ∫ t e dt = ∫ t e dt


x−1+ 1 −t x −t

0 0

integrating tha above expression by parts


i.e ∫ t e dt
x −t

recall: ∫ t e dt = uv - ∫ vdu
x x

du x−1
let u = t x ; =x t
dx
−t
du −t dv e
; integrate both sides ∫
dt ∫
−t
du = e dt −t
; =e = e ;v=
dt −1

r(x+1) = ∫ t e dt
x −t

= uv - ∫ vdu

[ ]
∞ −t
e−t e
) - ∫(
x x−1
= t ( )x t dt
−1 0 −1

= x ∫ t e dt
x−1 −t

Recall, r(x) = ∫ t
x−1 −t
e dt

= [0-0] + xr(x)

Hence, r(x+1) = xr(x) (2)


t‫ ﮷‬hus; r(x) =
r (x +1)
this called a Recurrence Relation for Gamma equations.
x

Γ(x+1) = xΓ(x) using the gamma sign

Γ(x) = (x-1)Γ(x-1) with this we can derive others

Γ(x+1) = x(x-1)Γ(x-1) ; Γ(x-1) = (x-2)Γ(x-2)

= x(x-1) (x-2)Γ(x-2) ; Γ(x-2) = (x-3)Γ(x-3)

= x(x-1) (x-2) (x-3)Γ(x-3)…..1 Γ(1) = x!Γ(1).


∞ ∞ ∞

Γ(1) = ∫ t e dt = ∫ t e dt = ∫ t e dt
x−1 −t 1−1 −t 0 −t

0 0 0


= [−e−t ]0 = 0+1 = 1

Γ(1) = 1

Γ(x+1) = x! provided x is positive integer.

i.e. Γ(10) = Γ(9+1) = 9! = 362880.

Or using recurrence relation in reverse, given that Γ(11) = 3628800 we can determine Γ(10)
by;

Γ ( x +1) Γ (10+1) Γ (11) 3628800


Γ(x) = , if Γ(10) = = = = 362880.
x 10 10 10

1
Now let us consider when x =
2

()

1
= ∫ t e dt
x−1 −t
Γ
2 0

= ∫t
1/ 2−1 −t
e dt
0

= ∫t
−1 /2 −t
e dt
0

dt
let t= U 2 ; =2 U ; dt = 2Udu; −1
U =t
−1
du

()
∞ −1
1 ( )
= ∫ U 2 e 2 Udu
2
2 −u
Γ
2 0

= 2∫ U
2
−1 −u
e Udu
0

= 2 ∫t e
2
−1 −u
t du ; t-1 /t = 1
0

= 2 ∫e
2
−u
du ……………………………………………………………..(3)
0

Hence, ∫ e
2
−u
du can not be easily resolve by normal means. So we can say that:
0

To Evaluate ∫ e
2
−x
dx
0

∞ ∞

Let I = ∫ e dx and I = ∫ e
2 2
−x −y
dy
0 0

( )( )
∞ ∞

∫e − x2
∫ e− y dy
2

I2 = dx
0 0

∞ ∞

= ∫ ∫ e− x + y dxdy
( 2 2
)

0 0

δa = δxδy represents an element of area in the x—y plane and the integration with the stated
limits covers the whole of the first quadrant.

Converting to polar coordinates, the element of area δa = r δθδr.

Also, x2 + y2 = r2

thus e−¿¿ = e−¿¿

For the integration to cover the same region as before,

the limits of r are r = 0 to r = ∞


the limits or θ are θ = 0 to r = п/2

from δa = r δθδr.
п /2 ∞

I = ∫ ∫e
−¿ ¿
2
¿¿
0 0

Integrating the r function above, we have

[ ]
п /2 2

e−r ∞
I =∫
2

0 2 0
п /2
1
I2 = ∫ dθ
0 2

= []
θ п /2
2 0
= п /4

I2 = п /4

√п = 2
∫ e−u du( in expression (3) above)
2

I=
2 0

Γ( 12 ) or Γ( 0.5 ) = 2 √2п = √ п , hence using Recurrence relation Γ (x+1) = x Γ (x) we can


determine different values of Γ (x)

Γ (3.5)
Example 1: Evaluate
Γ ( 4.5)

Solution

Γ (3.5) = Γ (1+ 2.5) ; Γ (2.5) = Γ (1+1.5) ; Γ (1.5) = Γ (1+ 0.5) = 0.5 Γ (0.5)

; Γ (0.5) = √ п from the established solution above.

: hence, Γ ( 1.5 )=0.5 Γ ( 0.5 )=0.5 √ п

; Γ (2.5) = Γ (1+1.5) = 1.5 Γ (1.5) = 1.5 (0.5 √ п ¿ = 3/4√ п

Γ (3.5) = Γ (1+ 2.5) = 2.5 Γ (2.5) = 2.5 (3/ 4 √ п ¿ = 15/8√ п

7 15
2 8 √
Γ (4.5) = Γ (1+ 3.5) = 3.5 Γ (3.5) = X ( п ¿ = 105/16√ п
Γ (3.5) Γ (3.5) 15/8 √ п ¿ ¿ 15 16
= =
8 105 √
To evaluate we can now say that X ( п¿ =
Γ ( 4.5) Γ ( 4.5) 105 /16 √п
2
7√
п

Γ (−1) Γ (−1+1) Γ (0)


Let us consider a negative value Γ (−2) = =∞ ; Γ (−1) = = =∞
Γ (−2) Γ (−1) Γ (−1)

Γ (1/2)
Γ (−1/2) = Γ ¿ ¿ = = -2 √ п
Γ (−1/2)

Using the explanation above we can determine other values in Assignment 1.

Assignment 1: Evaluate the following:

Γ (5.5)
1)
Γ (7.5)

Γ (−2.5 )
2)
Γ ( 4.5 )

Γ (−1.5 )
3)
Γ (−3.5 )

Γ (−7.5 )
4)
Γ (−4.5 )

Example 2: Evaluate I = ∫ x
2
1 /2 −x
e dx .
0

Solution

Let y = x2 ; dy = 2xdx

When x = 0, y = 0; x = ∞, y = ∞.

x = y1/2 ; x1/2 = y1/4


∞ 1 ∞ 1
1 −y
I = ∫ y e dy /2 x = ∫ ( y ¿ ¿ e ¿ dy )/2 y 2 ¿ ¿
4 −y

0 0 4
∞ −1
1
= ∫y 4 −y
e dy
20

1
= ∫ y e dy
v−1 − y
20

3
Where v =
4

1
Hence I = Г ( 3/4 ) = 0.613 recall that Г ( 3/ 4 ) =1.2254
2

Example 3: Evaluate∫ x e dx .
7 −x

Comparing to gamma function Г ( x )=∫ t


x−1 −t
e dt .
0

∞ ∞

Let write gamma function as Г ( v )=∫ t e dx = ∫ x e dx .


v−1 − x 7 −x

0 0

Since v – 1 = 7 ; v = 8

I = Г ( v )=Г ( 8 )=7 !=5040.


i.e. ∫ x e dx = Г ( 8 ) =7 !=5040.
7 −x

2. The Beta Function


The beta function B(m, n), is defined by
1

B (m, n) =∫ x
m−1 n−1
(1− x) dx which converges for m > 0 and n > 0
0

Putting ( 1−x )=u ; x = 1- u ; dx = - du

When x=0, u =1 ; x=1, u =0


1 0

B (m, n) =−∫ (1−u) du = ∫ (1−u)


m−1 n−1 m−1 n−1
u u du
0 1

B (n, m) = ∫ (1−u)
m−1 n−1
u du
1

B (n, m) = B (m, n)

Beta function can also be written in another form


1

B (m, n) =∫ x
m−1 n−1
(1− x) dx
0
If we put x = sin2 θ,
π
2
B (m, n) =2∫ sin2m−1 θ cos 2n−1 θ❑ dθ
0

Putting x=sin 2 θ , ; dx = 2sinθ cosθ dθ

π
When x=0, θ =0 ; x=1, θ = , 1- x = 1- sin2 θ=cos2 θ
2
π
2
B (m, n) =2∫ sin2m−2 θ cos 2n−2 θ❑ sin θ cos θ d θ
0

π
2
B (m, n) =2∫ sin2m−1 θ cos 2n−1 θ❑ d θ.
0

π
m−1 ( 2 m−1 )−1 2
B (m, n) = X ∫ sin 2m−3 θ cos 2n−3 θ❑ d θ.
m+ n−1 ( 2m−3 ) +(2 n−1)
0

m−1 ( n−1 )
B (m, n) = ¿ X B(m−1 , n−1)
m+ n−1 m+ n−2 ¿

This is also called reduction formula for B (m, n)

For example: B (4, 3) =

4−1 ( 3−1 )
B (m, n) = X B(4−1 , 3−1)
4+ 3−1 (4+3−2)

(3) (2) (3)(2)(2)(1)


B (m, n) = X B(3 , 2) = B(2 , 1)
(6) (5) (6)(5)(4)(3)

To determine B(2 , 1)
π

[ ]
2 4 π
B(2 , 1) = 2∫ sin 3 θcosθdθ=2 sin θ 2 = 1
0 4 2
0

(3)(2)(2)(1)
Hence B(4 , 3) = B(2 , 1)
(6)(5)(4)(3)

(3)(2)(2)(1) 1 ( 3 )( 2 ) ( 2 ) x (2)(1) (3 !)(2 !)


B(4 , 3) = = =¿
(6)(5)(4)(3) 2 (6)(5)(4)(3)(2)(2) (6 !)

Example 4: Evaluate the following


a . B(5 , 3),

b . B(6 , 2),

c . B(5 , 7).

Solution

m−1 ( n−1 )
B (m, n) = ¿ X B(m−1 , n−1)
m+ n−1 m+ n−2 ¿

Using the reduction formula

¿ ( 4 ) ( 2 )( 3 )( 1 )
 B(5 , 3) = B (5 ,3 ) = (4)(2)¿ ( 7 ) ( 6 ) B ( 4 ,2 ) = B ( 3 , 1)
( 7) ( 6) ( 5) ( 4 )

To determine B(3 , 1)
π π

[ ]
2 2 6 π
B(3 , 1) = 2∫ sin 5 θcosθdθ=∫ sin5 θ(sinθ)=¿ 2 sin θ 2 = 1 ¿
0 0 6 3
0

( 4 ) ( 2 )( 3 )( 1 ) ( 4 ) ( 2 ) (3 )( 1 ) 1 ( 2 ) ( 4 !)(2 !)
B (5 ,3 ) = B ( 3 , 1) = =¿
( 7) ( 6) ( 5) ( 4 ) ( 7) ( 6) ( 5) ( 4 ) 3 (2) (7 !)

Hence determine

 B(6 , 2),
 B(5 , 7).

Application of Gamma and Beta functions

The use of gamma and beta functions in the evaluation of definite integral depends largely on
the ability to change the variables to express the integral in the basic form of the beta
function.
1

∫ x m−1 ( 1−x )n−1 dx


0

Or its trigonometric form


π
2

2∫ sin2m−1 θ cos 2n−1 θ❑ dθ


0

Example 5: Evaluate I = ∫ x ( 1−x ) dx .


5 4

0
1

Compare this with B(m, n) = ∫ x


m−1 n−1
( 1−x ) dx
0

Then m-1 =5 ; m = 6. n -1 = 4 ; n = 5

I = B(6, 5) using the reduction formula

(5 !)( 4 !) 1
I = B(6, 5) = = .
(10!) 1260
π
2
Example 6: Evaluate I = ∫ sin 5 θcos 4 θdθ.
0

π
2
Compare this with B (m, n) = 2∫ sin2m−1 θ cos 2n−1 θ❑ dθ
0

Then 2m-1= 5; m=3 2n-1 = 4; n = 5/2

1 1 Г ( 4 ) Г ( 5 /2 ) 1 2 ! ( 3 √ π ) / 4 8
I = B(3, 5/2) = = x = .
2 2 Г ( 11/2 ) 2 ( 945 √ π ) /32 315

You might also like