0% found this document useful (0 votes)
68 views

Math Calculus

This document discusses differential calculus and key concepts such as: 1. Derivatives are used to find the gradient of a tangent line to a curve given by y=f(x). The derivative of f(x) is denoted as f'(x) or dy/dx. 2. The first principle formula is used to calculate derivatives and defines the limit process as the difference between f(x+h) and f(x) over h approaches 0. 3. Rules of derivatives include the additive rule, product rule, quotient rule and chain rule to find derivatives of combined functions. 4. Implicit differentiation is used when variables are mixed together in an equation rather than in explicit

Uploaded by

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

Math Calculus

This document discusses differential calculus and key concepts such as: 1. Derivatives are used to find the gradient of a tangent line to a curve given by y=f(x). The derivative of f(x) is denoted as f'(x) or dy/dx. 2. The first principle formula is used to calculate derivatives and defines the limit process as the difference between f(x+h) and f(x) over h approaches 0. 3. Rules of derivatives include the additive rule, product rule, quotient rule and chain rule to find derivatives of combined functions. 4. Implicit differentiation is used when variables are mixed together in an equation rather than in explicit

Uploaded by

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

Chapter 2 Differential Calculus

Calculus by definition is a study of small thing. What small thing ? We will look at this
in a short while.

2.1 Origin of Differentiation

Now suppose we want to find the gradient of a tangent line to a curve given by
y = f(x) ( Fig 1 )

Fig 1

Suppose P(x,f(x)) is the point on the curve where we are supposed to find the
gradient of the tangent line. We pick another point P1 on the curve and draw a line
joining P and P1 . This line is known as secant line . Suppose P1 has coordinate
( x+h, f(x+h)) . The gradient of this secant line is
f (x + h) _ f (x)
msec = . Now as h → 0 the point P1 will move closer and
h
closer to P. At the same time the secant line will approach the tangent line at P .
Thus the gradient of the secant line ( msec ) will approach the gradient of the tangent
line ( mtan ).

f (x + h) _ f (x)
Mathematically we write lim msec = lim = mtan .
h→0 h→0 h

This mtan is also known as the derivative of f(x) and oftenly denoted as f ‘(x).
dy
If y = f(x) then f ‘(x) is also written as . The d means difference in y and x .
dx

So as you can see the study of small thing is actually refers to h → 0 i.e becomes
smaller and smaller.

1
2.2 First Principle Formula

Definition

Suppose a continuous curve is given as y = f(x). Then the derivative of f is

f (x + h) _ f (x)
f ' (x) = lim .
h→0 h

The above formula is also known as First Principle Formula. This process of
finding derivative is commonly known as “differentiation”.

Example 1

Find f ‘(x) if f(x) = x2 + 3

Solution

2
Example 2

Find f ‘(x) if f(x) = x3 + 3x2 + 7

Solution

As you can see finding f ‘(x) every time using the First Principle Formula is
rather laborious. Instead mathematicians have worked out most of the f ‘(x) using
the formula and put it into a table for the benefit of most scientists and engineers.

f(x) f ‘(x) f(x) f ‘(x)


a 0 ax axlna
x 1 ex ex
x2 2x sinh x cosh x
axn naxn-1 cosh x sinh x
sin x cos x tanh x sech2 x
cos x - sin x loga x 1/xlna
tan x sec2 x ln x 1/x

Table of f ‘(x) for some functions

Example 3

4
Find the value of the gradient of the tangent line for f (x) = at x = 2.
x3

Solution

3
2.3 Rules of Derivatives

In many applications one works with a mixture of functions, not just single
function. For this mathematicians have provide certain proven rules for the purpose.

Rules for Differentiation

1. Additive Rule : ( f ± g )’ = f ’ ± g ‘ .

2. Product Rule: (f g ) ‘ = f g ‘ + g f ‘.

f gf ' _ fg '
3. Quotient Rule : ( )' = .
g g2

4. Chain Rule : (f (g)) ‘ = f ‘(g) g ‘ .

Example 4

Find f ‘(x) if f (x) = 5x4 + ln x - 4ex

Solution

Example 5

Find f ‘(x) for each of the f(x) below

6 sin x
(a) f(x) = x5cos x (b) f(x) = exlog2x (c ) f(x) =
x2 + 1

Solution

4
Sometimes we need to use more than a rule to find the derivative. See the
following example

Example 6

x 3e x
Find f ‘(x) if f(x) =
x ln x + 3

The following example will demonstrate the chain rule .

Example 7

Find f ‘(x) for each of the following f(x)

3
(a) f(x) = cos(7x) (b) f(x) = (8x2 + x)4 (c ) f(x) = ln(ln (x)) (d) f(x) = e x sin x

5
Often the case we need to use all the four rules as in the following example

Example 8

x 2e 3 x + 1
Find f ‘(x) if f(x) =
cos 3 x .

2.4 Implicit Differentiation

Often in the case an equation or expression is given in a mixed mode i.e the
variables x and y are mixed together.
For example x + y = 7 or x2 + y2 = 9 or y2 = xy + cos(xy) are example of the mixed
mode. Equations of this type is known as implicit form on contrary with the other
type which is explicit form. In explicit form y is given in terms of x only . In this way
the derivative is straight forward.

6
Now if given implicitly, how do we find the derivative ? We must aware that y is a
function of x. So to differentiate xy for example we need to use product rule since
y is a function of x.

d dy
So dx ( xy ) = x + y(1)
dx

d 3 d 3 dy
Also dx (y ) for example should be dx (y ) = 3y2 dx .

Example 9

dy
Find dx if xy3 + sin(y2) = x2 + y2

Example 10

Suppose x and y are functions of a variable t. If x2 - 3y = 2xy2 find the value of


dx dy
when = 2 at y = 1
dt dt

Solution

7
2.5 Applications of Derivatives

Aside from finding gradient of tangent lines to curve, derivatives found itself in lots
of applications. We will look at some of them.

2.5.1 Determining increasing or decreasing parts of curve

Given a curve y = f(x), how do we know where the curve is increasing or


decreasing ?

Typical continuous curve increases in either of the three types as shown in


Fig 2a, b, c.

Fig 2a Fig 2b Fig 2c

In any of the shape above you will notice that the gradient of the tangent line to
each one is positive. Similarly for the ones that are decreasing ( Fig 3a, b c .)

Fig3a Fig3b Fig 3c

We will have gradient of the tangent line to each one of decreasing components
are negative. So we have the following observation :

If f ‘(x) > 0 for a < x < b then f is increasing there


and if f ‘(x) < 0 for c < x < d then f is decreasing there.

Example 11

Find all the x values for which the graph of f(x) = 2x2 - 7x +5 is increasing .

Solution

8
Example 12

Find all values of x for which the graph of f(x) = 12xe3x is decreasing.

Solution

2.5.2 Determining maximum and minimum point of a curve.

Consider the minimum and maximum point of a graph ( Fig4 ) .

Fig4

The points A and C are the maximum points and B and D are minimum points. We
also call these points the extremum points. These extremum can be considered local
as they are the highest and lowest points compared to their left and right neighbours.

At these extremum points the tangent lines are horizontal, thus the gradient is zero.
The maximum point has tangent lines with positive gradient on the left and negative
gradient on the right ( Fig 5a) while the minimum point has tangent lines with
negative gradient on the left and positive gradient on the right. This observation will
lead to First Derivative Test. We will first define critical value and then state the test.

9
Definition

A value c is a critical value to a curve y = f(x) if either f ‘( c) = 0 or does not exist.

First Derivative Test


Suppose c is a critical value to a curve y = f(x).
If f ‘(c-) > 0 and f ‘(c+) < 0 then (c,f( c)) is a maximum point to the curve
and
If f ‘(c ) < 0 and f ‘(c ) > 0 then (c,f( c)) is a minimum point to the curve
- +

Note : We use the notation c- to denote a value a bit less than c and c+ to denote a
value a bit more than c .

Example 13

Given the function f(x) = 6x3 + 9x2 - 108x + 7. Find all extremum points.
Sketch the graph.

Example 14

Given the graph y = xln x . Find all extremum points to the graph.
Sketch the graph.

Solution

10
There is another alternative to spot these extremum i.e via Second Derivative Test.

At the minimum point (c,f( c)), f ‘(x) is negative on the left of this point and gradually
becomes less negative as it moves towards the minimum point and assume zero
value at the minimum point. Then as it moves to the right it gradually becomes more
and more positive. This means f ‘(x) is an increasing function . Thus the derivative of
f ‘(c) should be positive i.e f ‘’(c) > 0 .

Likewise at the maximum point, f ‘(x) is a decreasing function and hence f ‘’( c) is
negative i.e f ‘’(c ) < 0 .

Second Derivative Test

Suppose c is a critical value of to a curve y = f(x).


Then if f ‘’( c) > 0 then ( c, f( c)) is a minimum point and
if f ‘’( c) < 0 then ( c, f( c)) is a maximum point .

Example 15

Do Example 14 using Second Derivative Test.

Solution

11
Now what happen if f ‘’( c) = 0 ? . Well if this is the case then the test will be
inconclusive. First Derivative Test need to be carried out.

2.5.3 Finding rate of change

dy
If y = f(x) then f ‘(x) can also be written as dx . This is not just a symbol but
represent the change in y with respect to change in x . It comes from the First
Principle Formula where we can write

dy Δy
dx as Δlim
x → 0 Δx . This actually give the instantaneous rate of change at

x value.

Example 16

An inverted cone full of water leaks at the nozzle with 0.5 cm3/sec. The cone is 50
cm high and has radius 20 cm at the base. Find how fast the water level inside the
cone is dropping.

Solution

12
Example 17a

A ladder 3m long is slanted against a wall and is sliding down. The top of the
ladder is sliding down at the rate of 2cm/sec. Find the rate of the bottom part of the
ladder is moving on a smooth ground when the top part is 1m above the ground.

Solution

Example 17b

A ship travels along a straight line following the path of y = 2x + 3 and continues
travelling that path. A buoy is at coordinate of (50,80). Find the coordinate of the
ship when it is nearest to the buoy. Calculate this nearest distance.

13
2.4.4 Approximation

dy Δy dy Δy
As stated above dx = Δlim
x → 0 Δx . This means ≈
dx Δx
when Δx very small

dy
Thus Δy ≈ dx Δx when Δx very small .

This is what we call Approximation Formula. Since Δy is a change in y we can

estimate the new y by letting ynew = yold + Δy . Remember that Δx has to be

very small for the estimate to be good. The smaller the Δx the better will be the
estimate.

Example 18

2
Given y = x + 8 . Estimate the value of y when x is (a) 1.5 (b) 1.1

14
L’Hopital’s Rule ( Limits revisited )

Another application of finding limits.

f (x)
Suppose we are given and f(x) and g(x) have derivatives of all order.
g( x )
f (a) ∞ 0 f (x) f ' (x)
Suppose is in the form of or . Then lim = lim provided the
g(a) ∞ 0 x → a g( x ) x → a g' ( x )

limit on the right exists.

_
x → a can be replaced by x → ∞ or x → a + or a .

Example

Find the following limits

ln x sin x x_3 x 3 _ 2x 2  7
(a) lim (b) lim (c ) lim 2 _ _ (d ) lim
x → x x →0 x x →3 x x 6 x → 4 x 3 _ x _ 6

15
Calculus of Functions of two variables.

In general functions of two variables is written as z = f(x,y) where x


and y are the independent variables and z the dependent variables.
Often the case the equation is written in the form of f (x,y, z) = c . In
general the graph of these functions are surfaces in three dimension.

Below are some functions and the surfaces they represent.

z= x2 + y2 x2 + y2 = 4

x2 + y2 + z2 = 9 2x + 3y + 4z = 12

z2 = x2 + y2 x2 + y2 + z2/4 = 1

16
To differentiate these functions we have to do it partially. We
introduce the following :

Suppose z = f (x, y)

z
Denote  derivative of z with respect to x while y fixed
x

z
and  derivative of z with respect to y while x fixed.
y

The above are known as first partial derivatives. .

Example

Given z = x3y4 + 2x + y - 7

z z
Then  3 x2y4 + 2 .  4x3y3 + 2x + 1 .
x y

Example

z z
Given z = x2 sin (x/y) . Find ,
x y

z
To find , we have to employ product rule.
x

17
Most of the rules in functions of single variable are applicable here. However the
chain rule needs modification.

Chain rule of functions of two variables

Suppose z = f (x,y) and x = g( r,s) and y = h(r,s)

z z x z y z z x z y
   
Then r x r y r and s x s y s .

Example

Given z = x2 + 2y x = r s2 y = 2r - s

z

Then r

z

s

18
Approximation and Normals of functions of two variables

It can be shown that if z is a change in z resulting from x and y change

by very small change of x and y

z z
then z  x  y .
x y
We call this The Small Increment Formula. The smaller the change in x and y
the better will be the approximation.

Example

Given z = 2x3 + y2 . If x changes from 5 to 5.1 and y changes from 3 to 2.9


find the change in z . approximate the new z.
Repeat if x changes from 5 to 5.01 and y from 3 to 2.97 .

Normals to surfaces.

Since z = f(x,y) will always give us surfaces then given a point on a surface there
will be a tangent plane to this surface.

19
It can be shown that the normal vector to the tangent plane of the surface
z = f(x,y) is given as the vector

z z z z
n=  , ,1  or  , ,1  . More generally if a surface is
x y x y
given as F (x, y, z ) = c where c is constant then the normal vector to the surface

F F F
is n =  , , 
x y z .

Sometimes we denoted this vector as grad F or  F.


Example

Find a vector normal to the surface z = x2 + 4y2 at (3, -2) .

Example

Find a vector normal to the paraboloid x2 + y2 + z2/4 = 19 at (1,3)

20
Lagrange Mutiplier

This is a method to find minimum or naximum of a function f when a constraint


g(x, y, z ) = 0 is given. It turns out that the minimum or maximum of f will satisfy the
equation grad f = kgrad g where k is known as Lagrange Multiplier. The
preceding equation is solved together with the constraint equation.

Example

Find the maximum and the minimum of f(x,y) = xy when the constraint is
4x2 + 8y2 = 16 .

21
Example
Find the point on the sphere x2 + y2 + z2 = 36 that are closest to and farthest from
the point (1, 2, 2).

22
Chapter 3 Integral Calculus

3.1 Origin of integral

Suppose we are to find area under a curve y = f(x) as shown in Fig 1 .

Fig 1

One way to do this is to draw thin rectangles onto the graph and estimate the total
area of these rectangles . We enlarge Fig 1 for you to see what is going on. ( Fig 2)

Fig 2

Suppose the area under the curve = A

Then A ≈ sum of all rectangles under the graph.


Each rectangle has area = y Δx where y = f(x) and Δx = width of rectangle.

x =b

So A ≈ �yΔx .
x =a

For A to be more accurate Δx has to be very small, which means we have to take
more and more rectangles. Then how can A be exact ? Well, we have to make
Δx → 0 and at the same time the number of rectangles goes to infinity.

x =b

Mathematically A = lim �yΔx .


Δx → 0
x =a

b
The last expression above is written as ∫
a
ydx

The notation ∫ is symbol for integral which is widely used.


b
Now how do we calculate ∫
a
ydx ? This is the answer supplied by many eminent
mathematicians such as Newton, Leibnitz, Riemann and Darboux.

1
Later we will see how ∫ relates itself to derivative that we studied.

3.2 Integral as Reverse Process to Differentiation

Mathematicians realised that there is a relation between integral ∫ and derivative.


They discover that they are reverse to each other ;

d
So if
dx
( f (x)) = g(x) then ∫ g(x)dx = f (x) .
This is the most important discovery for which it arises to the birth of integral
calculus.
Using the above we can quickly can many formulae to integration as shwn in the
table below.

f(x) f(x)
∫ f (x)dx ∫ f (x)dx
1 x ex ex
a ax cos x sin x
x x2/2 sin x - cos x
axn ax /(n+1) n ≠ -1
n+1
tan x - ln cos x
1/x ln x sec2 x tan x
ax a /ln a
x
cosh x sinh x

To check whether the entries are correct we can differentiate the second and the
fourth columns and see that they are equal to the first and hhird column
respectively.

d ax 1 x ax
For example ( )=
dx ln a ln a
(a ln a) = a x . Hence ∫ a dx = ln a .
x

d ax n +1 a
Also for n ≠ -1 ( )= ((n + 1) x n ) = ax n .
dx n + 1 n +1
n +1
ax
Hence ∫ ax n dx = .
n +1

Notice that if we add in constant C to the expression that we differentiated,


d 1 1
the answer will be the same. For example (ln x + C ) = . Hence ∫ dx = ln x + C .
dx x x

So officially we should add in constant C to each of the entries in column 2 and 4


above.

2
Using the table we can straight away conclude that
_
7x 4 1 x 5 +1 _ 1
(a) ∫ 7 x dx = + C (b) ∫ 5 dx = ∫ x dx = _
_
3 5
= +C
4 x 5+1 4x4

5
3
x2 5
( c) ∫ 5 x 3
dx = ∫ 5 x dx = 5
2
5
= 2 x 2
+C .
2

b
We also have ∫a
f (x) dx = F (a) _ F (b) where ∫ f (x)dx = F (x) + C

3.3 Rules of Integration

We have certain proven rules to ease us in performing integration.

1. ∫ f (x) ± g(x)dx = ∫ f (x)dx + ∫ g(x)dx .


2. ∫ cf (x) dx = c ∫ f (x) dx .
b
3. If f(x) ≥ 0 on a ≤ x ≤ b then ∫ f (x) dx ≥ 0 .
a
a b
4. ∫ b
f (x) dx = _ ∫ f (x) dx .
a
b c b
5. If a < c < b then ∫a
f (x) dx = ∫ f (x) dx + ∫ f (x) dx .
a c

Example 1

2 x 3 + 3x + 7
Evaluate ∫ x 2 dx .
Solution

Example 2

7 2 7
Given that ∫ g(x)dx = 10
2
and ∫ g(x)dx = 4. Find ∫ g(x)dx.
5 5

3
3.4 Techniques of Integration

Of course the table alone won’t help very much to integrate complicated functions.
We need certain technique to get around it.

3.4.1 Substitution Method or Change of Variable

du
In this method we let u = h(x) and then find. We manipulate this and
dx
substitute into the integral so as to change the x form to u form.

Example 3

Evaluate each of the following (a) ∫e 2x


dx (b) ∫ cos 7 x dx (c ) ∫ (x 2 + 7) 5 x dx

Solution

1 1
In general ∫e ax
dx = e ax + C ,
a ∫ cos ax dx = a sin ax + C .

4
Example 4
1
Evaluate each of the following (a) ∫ x ln x dx (b) ∫ sin 3
x cos x dx
1
(c ) ∫ ax + b .
dx

Solution

Example 5

2
∫ ( x + 2)
3
Evaluate x dx
1

5
3.4.2 Integration By Parts ( IBP )

When we differentiate f(x)g(x) we get


d d d
( f (x)g(x)) = f (x) (g(x)) + g(x) ( f (x)) .
dx dx dx

Thus d ( f (x)g(x)) = f (x)d (g(x)) + g(x)d ( f (x))

Integrating left and right of the equation yield

f (x)g(x) = ∫ f (x)d (g(x)) + ∫ g(x)d ( f (x)) and hence

∫ f (x)d(g(x)) = f (x)g(x) ∫ g(x)d( f (x)) .


_

If we let u = f(x) and v = g(x) the above can be written as

∫ udv = uv ∫ vdu
_

which is the famous integration by parts formula and is usually written this way.

As seen integration by parts can be implemented for integration of certain


products of functions. The u and dv need to be properly selected to make the
technique works.

Example 6

Evaluate (a) ∫ x sin 3x dx (b) ∫ x cos 3x dx (c ) ∫x 2


sin 3x dx

6
As seen in ( c) , the method is rather laborious. Imagine if we need to find
∫x 4
sin 3x dx . To get around this a tabular form of IBP is designed. In this form
we will have two columns, one for differentiating and another one is for
integration. We will show how we do this tabular form for ∫x 2
sin 3x dx and

∫x 4
sin 3x dx .

Example 7

Evaluate each of the following (a) ∫ ln x dx (b) ∫e 2x


cos 3x dx .

7
3.4.3 Integration By Partial Fractions

You must be familar with the calculation in high school such as

1 3 (4 + x ) + 3x 4 + 4 x
+ = = .
x x +4 x(x + 4) x(x + 4)

1 3 4 + 4x
So given + we arrive to .
x x +4 x(x + 4)

4 + 4x 1 3
Now what if is given. How can we arrive to + ?
x(x + 4) x x +4

The answer lies in the technique of Partial Fractions.

This technique governed by the following rule :

Rule of Partial Fractions

p(x)
Suppose we have where p and q are polynomials and deg(p) < deg(q).
q( x )

p(x)
(a) If q contains linear factors (ax + b)(cx + d) then contains partial
q( x )
A B
fractions of the form + .
ax + b cx + d
p(x)
(b) If q contains linear factors (ax + b)(cx + d)2 then contains partial
q( x )
A B C
fractions of the form + + .
ax + b cx + d (cx + d )2

(c) If q contains linear factors of the form (ax + b)(cx2+ dx + e) then

8
p(x) A Bx + C
contains partial fractions of the form + 2 .
q( x ) ax + b cx + dx + e

Example 8

3 3
Express
x(2 x + 1)
into partial fractions. Hence evaluate ∫ x(2 x + 1) dx .

Example 9

2x + 3 2x + 3
Express
(x + 2)(2 x + 1)2
into partial fractions. Hence evaluate ∫ (x + 2)(2x + 1) dx .

9
Example 10

x x
Express
(x + 3)(x 2 + 4)
into partial fractions. Hence evaluate ∫ (x + 3)(x 2
+ 4)
dx .

10
3.4.4 Integration Using Trigonometric Identities

In this section we will learn how to integrate some of the trigonometric of the
functions. We will use some of the identities and formulae in trigonometry.
Here are some of the identities that are oftenly used in this integration.

Basic Identities

1. cos2 x + sin2 x = 1
2. 1 + tan2 x = sec2 x
3. 1 + cot2 x = cosec2 x

Double Angle Formula

4. sin 2x = 2sin x cos x


5. cos 2x = cos2 x - sin2 x = 2cos2 x - 1= 1 - 2sin2 x

Product Formula
1
6. sin x sin y = [cos (x _ y ) _ cos( x + y)]
2
1
7. cos x cos y = [cos (x _ y )+ cos( x + y)]
2
1
8. sin x cos y = [sin(x + y )+ sin( x _ y)]
2
1
9. cos x sin y = [sin(x + y ) _ sin( x _ y)]
2

Example 11

Find each of the following (a) ∫ sin x cos 2 x dx (b) ∫ cos 3 x dx (c ) ∫ sin
2
x dx

11
Example 12

Evaluate ∫
0
2
cos 2 x cos 5x dx .

12
3.5 Applications of Integral

3.5.1 Finding Area Under a Curve and Between Two Curves.

In early part of this chapter we have discussed a bit on finding area under a curve. In
this section we will learn to calculate the area.

A. Area between graph y = f(x) and x axis

Consider a region between the graph of a function y = f(x) and x axis from
x = a to x = b . ( Fig 3 )

Fig 3

Suppose the area that we seek is A.


The area of an arbitrary rectangle is ydx . We sum up all the rectangles to get

b b
A= ∫a
y dx or ∫
a
f (x) dx .

Example 13

Find the area between the graph y = x2 + 3 and x axis between x = 2 to x = 5.

Solution

13
Example 14

Find the area enclosed by the graph y = x2, y = 6 - x and x axis

Solution

B. Area between graph x = g(y) and y axis.

Consider the region between graph x = g(y) and the y axis from y =c to y = d.
( Fig 4 )

Fig 4

Suppose the area is A .


We now draw the rectangles onto A parallel to x axis . The area of each
rectangle with width dy is xdy . Sum up all the rectangles will lead us to the
formula

d d
A= ∫ x dy
c
or ∫ g(y)dy
c

14
Example 15

6
Find the area between y = and the y axis from y = 1 to y = 5.
x

C. Area between two graphs ( upper and lower graphs ).

Suppose the upper graph is y2 = f(x) and the lower graph is y1 = g(x).
Let A be the region between the two graphs, from x = a to x = b. ( Fig 5 )

If we draw vertical rectangles onto A then each rectangle with width dx will
have length y2 - y1 . Thus each rectangle will have area (y2 - y1)dx . This leads us to
the formula for A as

b b
A= ∫ (y
a 2
_
y1 ) dx or ∫ ( f (x)
a
_
g(x)) dx

b
This A can also be memorised as ∫ (upper
a
graph _ lower graph) dx .

15
Example 16

Find the area between the graph y = x(6 - x) and y = x.

D. Area between two graphs ( left and right graph )

Suppose the right graph is x2 = f(y) and left graph is x1 = g(y) . Let A be the area
between the two graphs between y = c and y = d ( Fig 6 )

Fig 6

Draw horizontal rectangles onto A . The width of a rectangle is dy and length for
each rectangle is x2 - x1 . Thus the area is (x2 - x1)dy . This leads to the formula of
A as

d d
A= ∫ (x
c 2
_
x1 ) dy or ∫ ( f (y)
c
_
g(y)) dy

d
A can also be memorised as A = ∫ (right graph
c
_
lef graph) dy .

16
Example 17

Find the area enclosed by the graphs y = 6 - x, y = -2x and the x axis .

Solution

3.5.2 Finding Volume Of Revolution .

Imagine that the region between the graph y = f(x) and x axis from x = a to x = b
is revolved 3600 about the x axis. If the region is a right triangle ( Fig 7a ) then we
will obtain a full cone (Fig 7b)

Fig 7a Fig 7b Fig 7c

This cone is an example of a solid of revolution. If the region is made up of very


thin rectangles with width dx , then when revolved about the x axis we will get a
series of discs with radius y and thickness dx. One disc has volume πy 2dx .( Fig 7c)
Summing up the volumes for all the disc will lead us to the volume of the solid. In
this case the volume of the solid is

b b
V= ∫ πy
a
2
dx or ∫ π( f (x))
a
2
dx .

17
Example 18

The region bounded by y = x2, x = 2 and x = 5 and x axis is revolved about the x
axis. Find the volume of the solid generated.

Solution

Example 19

Prove that the region bounded by a semicircle with equation y = a 2 _ x 2 and x


4 3
axis and when revolved about the x axis has volume πr .
3

Solution

18
Integration of Functions of two variables

The general form is  f (x , y)dA where R is a region on the xy plane .


R
For our purpose we will take R to be a rectangular region on xy plane and
z = f(x,y) will be a surface above( or below) it . dA can be taken as dydx or dydx.

When the integral is computed it will give the volume of a solid with base R and
top the surface z = f(x,y) .

Let us first look at how the integral is evaluated.

To find the value of  f (x , y)dA when R is given as


R

4 5 2
and f(x,y) = x2y + y we will let  f (x , y)dA = 1 2 x y  y dydx
R

Example

4 5 2
Compute 1 2 2 x  3y dydx . Interpret the value.

19
Ordinary Differential Equations

Often the case especially in engineering we are given for example equations
involving rate of change. Suppose velocity is twice that of time . Find the velocity,
displacement and so on.

If velocity is v and time is t then v = 2t . Since v = ds/dt where s is


displacement then ds/dt = 2t.

Th last equation above is an ordinary differential equation written in short as


ODE. There are many types of ODE. We will learn only the simple ones.

Firstly every ODE must have an order. This order is given as the highest order of
derivative in the equation.

Example
Determine the order of each

1. dy/dx = x2 + 1
2. d2y/dx2 = dy/dx - 7x
3. (dy/dx)4 + d3y/dx3 = cos x

Solving ODE

ODE is solved according to its type. We will learn two types of ODE of First Order

1. Separable equation

An ODE which can be separated the x on one side and the y on the other side.

When separated the x and the y we have the form f(y)dy = g(x)dx. The
solution to the equation can then be found by integrating both sides.

Example

Solve dy/dx = xy +y

20
Example

Solve : exdy/dx = y3 ,
y = 1 when x = 0

In the above example the condition y =1 when x = 0 is known as initial condition.

2. Linear Equation

Equation of this type takes the form dy/dx + P(x)y = Q(x).

P ( x )dx
To solve this equation we multiply the left and right by e  , which is known
as integrating factor. Let us remind that before multiplying ensure rhat the
equation must be in the above form.

Example Solve dy/dx + y/x= sin x y(0) = 1

21
Example Solve xdy/dx + (3x + 1)y = x2

22
Chapter 4 Numerical Methods

4.1 Trapezoidal Rule


b
This rule is to approximate the value of ∫ a
f (x) dx oftenly if the integral cannot be
evaluated by all the techniques that we learnt. We state the rule here.

Trapezoidal Rule

Let f be continuous on [a,b]. Then

b b_a
∫a f (x)dx ≈ 2n [ f (x0 ) + 2 f (x1 ) + 2 f (x2 ) + .... + 2 f (xn _ 1 ) + f (xn )]
b_a
where xk = a + k for k = 0, 1, 2, …, n.
n
b
As n → ∞ the right hand side will approach ∫a
f (x) dx .

Example 1

2
Use Trapezoidal Rule to approximate ∫x
0
3
dx using n = 8.
Check your answer using straight forward integration.

Solution
b_a 2
a = 0, b = 2 , n = 8. Δ= = = 0.25
n 8

We build a table for our ease

k xk f(xk) m
0 0 0 1
1 0.25 0.0156 2
2 0.5 0.1250 2
3 0.75 0.4219 2
4 1.0 1.000 2
5 1.25 1.9531 2
6 1.5 3.3750 2
7 1.75 5.3594 2
8 2.0 8.000 1

Total = 32.5
2 2
∫0 x 3 dx ≈ 2(8) [Total ] = 4.0625 Check : Exact ans is 4.

1
Example 2

Consider a plot of land with given coordinates. Estimate the area of the land by
Trapezoidal Rule.

0 1 2 3 4 5 6

Solution

Trapezoidal Rule ( Case of two functions )

Let f and g be continuous on [a,b].

b_a
∫ ( f (x) g(x))dx ≈
b
_
Then [Δ 0 + 2Δ 1 + 2Δ 2 + ... + 2Δ n _ 1 + Δ n ]
a 2n
where Δ k = f (x k ) _ g(x k ) k = 0,1,2,...., n and
b_a
xk = a + k for k = 0, 1, 2, …, n.
n

2
Example 3

∫ (4 x 3x )dx using n = 5. Check with the exact answer.


3
3 _
Estimate
1

Solution
b_ a
a = 1, b = 3 , n = 5 = 0.4 f(x) = 4x3 g(x) = 3x
n
k xk f(xk)-g(xk) m
0 1 1 1
1 1.4 6.776 2
2 1.8 17.928 2
3 2.2 35.992 2
4 2.6 62.504 2
5 3.0 99 1

Total = 346.4

2
∫ (4 x 3x )dx ≈
3
3 _
(Total ) = 69.28 Exact = 68.
1 2(5)

Notice that the error is 1.28. Should we use n > 5 then the estimation would be
better.

This Trapezoidal Rule of two functions can be used if we know the difference
between two ordinates.

Example 4

Consider a plot of land below with difference in ordinates given. Estimate the area
of the land.

3
4.2 Simpson’s Rule

Another estimation to the integral is Simpson’s Rule. It uses quadratic functions


based on three points. Generally the estimation is more accurate compared to
Trapezoidal Rule.

Simpson’s Rule

Let f be continuous on [a,b] and let n be even. Then

b b_a
∫a f (x)dx ≈ 3n [ f (x0 ) + 4 f (x1 ) + 2 f (x2 ) + 4 f (x3 ) + ... + 4 f (xn _ 1 ) + f (xn )]
b_a
where xk = a + k for k = 0, 1, 2, …, n.
n
b
As n → ∞ the right hand side will approach ∫a
f (x) dx .

Example 5

5
Estimate ∫ x ln x dx
2
using n = 6.

Solution

b_a
a=2 b=5 = 0.5
n

k xk f(xk) m
0 2 1.3863 1
1 2.5 2.2907 4
2 3.0 3.2958 2
3 3.5 4.3847 4
4 4.0 5.5452 2
5 4.5 6.7683 4
6 5.0 8.0472 1

Total = 80.8903
5 5_2
∫2 x ln x dx 3(6) (Total ) = 13.4817.

Exact ( using IBP ) = [ (x2/2)ln x - x2/4]25 = 13.4817.

4
Simpson’s Rule ( in case of two functions )

Let f and g be continuous on [a,b].

b_a
∫ ( f (x) g(x))dx ≈
b
_
Then [Δ 0 + 4Δ 1 + 2Δ 2 + ... + 4Δ n _ 1 + Δ n ]
a 3n
where Δ k = f (x k ) _ g(x k ) k = 0,1,2,...., n and
b_a
xk = a + k for k = 0, 1, 2, …, n.
n

Example 6

Rework Example 4 using Simpson’s Rule for the case of two functions.

5
4.3 Newton’s Method for Approximating Roots

In this section we will learn how to estimate roots of equations. Some equations
are quite easy to find the root such as 2x - 9 = 1 which will give the root x = 5 .
However many equations are difficult to find the roots for example 4sin x = x
Although the equation seems to be very simple but to find the root ( the x value ) is
difficult. We have no other alternative but to estimate.

There are many estimation methods of finding roots. One of them is Newton’s
Method.

Suppose x0 is an approximation root to f (x) = 0.


From First Principle Formula we have
f (x 0 + h) _ f (x 0 )
f ‘(x0) = lim .
h→0 h

f (x 0 + h) _ f (x 0 ) f (x 0 + h) _ f (x 0 )
This means f ‘(x0) ≈ or h ≈ when h is small.
h f '(x 0 )

If x0+h is a better approximation to the root, f(x0+h) ≈ 0.

_ f (x 0 ) _ f (x 0 )
So h ≈ . Therefore a better root is x0 + h ≈ x0 .
f '(x 0 ) f '(x 0 )

Newton’s Method for approximating roots

Consider in finding roots to the equation f(x) = 0 where f is differentiable.


f (x n )
Suppose xn is an approximate root. Then x n +1 = x n _ is a better
f '(x n )
approximation to the root provided f ‘(xn) is not too small compared to f (xn).

Before we go on giving example , let us look at a theorem which will ease us in


picking up candidates to the root of equations.

Theorem
Suppose f(x) is continuous on [a,b] and suppose f(a) > 0 (or < 0) and
f(b) < 0 ( or > 0) . Then there is a c in (a,b) such that f( c) = 0.

The above theorem which we gave without proof guarantees that f(x) = 0 has at
least a root if f is continuous on [a,b] provided f(a) and f(b) have different signs.

6
Example 7

Approximate a root to the equation ex = 3 - x .

Solution

First we rewrite the equation as ex + x - 3 = 0 . Let f (x) = ex + x - 3. By trying some


values of x we get f (1) = 0.718 > 0 and f (0)= -2 . By the above theorem since f
is continuous on [0,1] the root must be in (0,1) . Clearly f ‘(x) = ex + 1

Let the first root be x0 = 0.5 . Then f (0.5) = -.8513 and f ‘(0.5) = 2.6487
Putting into Newton’s Formula we get

_ .8513
x1 = 0.5 - = 0.8214.
2.6487

f (x1) = f (.8214) = .0951, so x1 is a better estimate. For even better estimate


we again use the formula to find x2 using x1.

0.0951
x2 = 0.8214 - = 0.7924.
3.2737

f (x2) = f (0.7924) = 0.0011 which is of course very near to 0.

Proceed to x3 with f ’( 0.7924) = 3.2087 we get

0.0011
x3 = 0.7924 - = 0.7921
3.2087

If we let our final root to be 0.792 we have given the answer correct to 3 dec.
places as the first three decimals of x2 and x3 are the same.

Example 8

Show that the equation 2sin x - x = 0 has a root between 1 and 2.


Use Newton’s Method to approximate the root of using first trial root x0 = 1.
Comment.

Solution

Let f (x) = 2sin x - x .


Then f (1) = 0.6829 and f (2) = -0.1814. Since f (1) and f (2) have different
signs, by the above theorem a root must exists between 1 and 2 .
f ‘(x) = 2cos x - 1

7
0.68290
So x1 = 1 - = -0.75509, which is out of range.
0.0806
Notice that f ‘(1) is too small compared to f (1) . Use trial root = 1.5 .

Example 9

1 a
To find a one can use the Mechanic Formula xn+1 = ( x n + ) , n =1,2,…
2 xn
Derive this formula using Newton’s Method. Use the formula above to estimate
10 correct to two dec. places.

4.4 Lagrange Interpolation

Oftenly we need to estimate a point between two known points, or three known
points etc. How can we do this ? One answer to this is interpolation. In this section
we will look into three types of interpolation : Linear Interpolation, Lagrange
Quadratic Interpolation and Lagrange Cubic Interpolation.

4.4.1 Linear Interpolation

Suppose two points are known P0(x0, y0) and P1(x1,y1) . For given x where x0
< x < x1 we wish to find P(x,y) .
Now to find the y value we can draw straight line joining P0 and P1 ( Fig 1 ) and
draw right angle triangle beneath it.

Let P(x,y) be the point we wish to seek and it is on the line between P0 and P1.

8
Fig 1

y _ y 0 y1 _ y 0
If m is the gradient then mP0P = mP0P1 ⇒ _ = _ .
x x 0 x1 x 0

y1 _ y 0 _ x _ x1 x _ x0
Thus ⇒ y = y 0 + _ (x x 0 ) = y 0 _ + y1 _ .
x1 x 0 x 0 x1 x1 x 0

The above formula can be written as y = �y L i i where


i =0

x _ x1 x _ x0
L0 = _ and L1 = = _ .
x 0 x1 x1 x 0

Linear Interpolation Formula

Suppose points P0(x0, y0) and P1(x1,y1) are known. Then for a given x ,
y can be estimated by

1
x _ x1 x _ x0
y = �y i Li where L0 = and L1 = = .
i =0 x 0 _ x1 x1 _ x 0

Example 10

Given P(2,5) and Q(9, 50) . Find the value of y if x = 6.

Solution

Here x0 = 2 y0 = 5 x1 = 9 y1 = 50.

6_9 6 _ 2 215
y = y0L0 + y1L1 = 5( _ ) + 50( _ ) = ≈ 30.714 .
2 9 9 2 7

9
4.4.2 Lagrange Quadratic Interpolation

Now suppose three points are known. Then we can find a quadratic function
through all these three points. The interpolation formula is just an extension to the
above formula.

Lagrange Quadratic Interpolation

Suppose points P0(x0,y0), P1(x1, y1) and P2(x2,y2) are known. Then for a given x,
y can be estimated by

y= �y L i i
i =0

x _ x1 x _ x 2 x _ x 0 x _ x2 x _ x 0 x _ x1
where L0 = ( )( ) L 1 = ( )( ) L == ( )( )
x 0 _ x1 x 0 _ x 2 x1 _ x 0 x1 _ x 2 2 x 2 _ x 0 x 2 _ x1 .

Example 11

Given three points (1,17), (5,69) and (10,179). Estimate the value of y if x = 7.

Solution

x0 = 1 y0 = 17 x1 = 5 y1 = 69 x2 = 10 y2 = 179

7 _ 5 7 _ 10 7 _ 1 7 _ 10 7_1 7_5
y = y0L0 + y1L1 + y2L2 = 17( _ )( _ ) + 69( _ )( _ ) + 179( _ )( _ ) = 107.
1 5 1 10 5 1 5 10 10 1 10 5

10
Example 12

Given the following plotted points. Find a quadratic function which can
estimate the curve.

If we have four points then Lagrange Cubic Interpolation will be appropriate.

4.4.3 Lagrange Cubic Interpolation

Lagrange Cubic Interpolation

Suppose points P0(x0,y0), P1(x1, y1) , P2(x2,y2) and P3(x3,y3) are known. Then for a
given x, y can be estimated by
3

y= �y L i i
i =0

x_ x x_ x x_ x x_ x x_ x x_ x
where L0 = ( _ 1 )( _ 2 )( _ 3 ) L1 = ( _ 0 )( _ 2 )( _ 3 )
x0 x1 x0 x2 x0 x2 x1 x0 x1 x2 x1 x3

x _ x0 x _ x1 x _ x3 x _ x0 x _ x1 x _ x2
L2 = ( _ )( _ )( _ ) L3 = ( _ )( _ )( _ )
x2 x0 x2 x1 x2 x3 x3 x0 x3 x1 x3 x2

11
Example 13

Given four points (1,6), (2,31), (5,454), (8, 1903) . Estimate the value of y when
x = 6.

Solution

x0 = 1 y0 = 6 x1 = 2 y1 = 31 x2 = 5 y2 = 454 x3 = 8 y3 = 1903

y = y0L0 + y1L1 + y2L2 + y3L3=


6_2 6_5 6_8 6_1 6_5 6_8 6_1 6_2 6_8 6_1 6_2 6_5
6( _ )( _ )( _ ) + 31( _ )( _ )( _ ) + 454( _ )( _ )( _ ) + 1903( _ )( _ )( _ )
1 2 1 5 1 8 2 1 2 5 2 8 5 1 5 2 5 8 8 1 8 2 8 5
= 791.

Example 14
The points (0,-23), (2,-25), (3,1) and (5,167) are on a cubic polynomial. Find the
polynomial.

By Lagrange we have y =

 _ _ _  _ _ _ _ _ _ _ _ _
  23( x 2 )( x 3)( x 5 )   25( x 0 )( x 3 )( x 5 )  1( x 0 )( x 2 )( x 5 )  167( x 0 )( x 2 )( x 3)
 0 _ 2 0 _ 3 0 _ 5  2_0 2_3 2_5 3_ 0 3_ 2 3_5 5_0 5_2 5_3

23 3 25 1 167 3
 (x  10 x 2  31x  30)  (x 3  8 x 2  15 x)  (x 3  7 x 2  10 x)  (x  5 x 2  6 x)
30 6 6 30

 2 x 3  x 2  7 x  23.

12
Numerical Solution To Non Linear First Order ODE

1. Euler Method

We assume the equation is in the form dy/dx = f(x,y) and


given y = y0 when x = x0 . Define the step size h for x.

Use the formula yi+1 = yi + f(xi, yi)h, xi+1 = xi + h


We seek the approximate value of y at xi . The smaller the h the more
accurate will be the approximation. But the computation will be more
laborious.

Before we go to non linear example we look first at the equation which can be
solved by methods studied.

Example

Solve using Euler’s Method the equation dy/dx = x + y/5 , y(0) = -3


(a) first with step size h = 1 on the interval [0,5]
(b) then with step size h = 0.2 on the interval [0,1]

Solution
The equation can be put into dy/dy - (1/5)y = x which is linear.
If we solve using the method studied we get y = 22ex/5 -5x - 25.
This is the exact solution to the equation.

h= 1:
With x0 = 0 y0 = -3 and f(x,y) = x + y/5
we have y1 = y0 +f(x0,y0)h
=-3+ f(0,-3)(1)=-3+(-0.6)= -3.6
y2 = y1 +f(x1,y1)h
= -3.6+f(1,-3.6)(1) = -3.32
y3 = y2 +f(x2,y2)h
= -3.32 + f(2, -3.32) = -1.984
y4 = y3 +f(x3,y3)h
= -1.984+f(3,-1.984)= 0.6192
y5 = y4 +f(x4,y4)h
= 0.6192 + f(4, 0.6192) = 4.7430.

13
h=0.2 :
y1 = y0 +f(x0,y0)h
=-3+ f(0,-3)(0.2)=-3+(-0.12)= -3.12
y2 = y1 +f(x1,y1)h
= -3.12+f(0.2,-3.12)(0.2) = -3.205
y3 = y2 +f(x2,y2)h
= -3.205 + f(0.4, -3.205)(0.2) = -3.253
y4 = y3 +f(x3,y3)h
= -3.253+f(0.6,-3.253)(0.2)= -3.263
y5 = y4 +f(x4,y4)h
= -3.263 + f(0.8, -3.263) = -3.234

Using computer programs we can generate the following table.

x Yapprox h= 0.2 Yapprox h= 0.02 Yapprox h= 0.002 Yactual


0 -3.000 -3.000 -3.000 -3.000
0.2 -3.120 -3.104 -3.102 -3.102
0.4 -3.205 -3.172 -3.168 -3.168
0.6 -3.253 -3.201 -3.196 -3.195
0.8 -3,263 -3.191 -3.184 -3.183
1 -3.234 -3.140 -3.130 -3.129

Example

Solve the non linear ODE : dy/dx = x + y1/2, where y(0)= 1. Use step size of
h = 0.5. Solve for y when x = 2.

14
Solution
x0 = 0 y0 = 1 f(x,y) = x + y1/2

Y1 = 1 + f(0,1)(0.5) = 1.5
Y2 = 1.5 + f(0.5,1.5)(0.5) = 2.3624
Y3 = 2.3624 + f(1.0, 2.3624)(0.5) = 3.6309
Y4 = 3.6309 + f(1.5,3.63091)(0.5) = 5.3336

We can improve the above solution by taking smaller h such as h = 0.02

2. Runge-Kutta Fourth Order Method

This is perhaps the most popular to many engineers and scientist. However it is
not very convenient like Euler’s Method.

Again we want to solve non linear dy/dx = f(x,y) , y(x0) = y0


We use yi+1 = yi + 1/6( k1 + 2k2 +2k3 + k4) h .
where k1 = f(xi,yi)
k2 = f(xi+h/2, yi+ 0.5k1h)
k3 = f(xi+h/2, yi+ 0.5k2h)
k4 = f(xi+h, yi+ k3h)
Define step size for h. xi+1 = xi + h.

We calculate all the values for k’s and pluck into the formula yi+1.
Note that y0, y1, y2,…. corresponding to x0, x1, x2,…..

Example

Repeat the last example and approximate y at x = 1.

Solution
x0 = 0 y0 = 1 f(x,y) = x + y1/2
k1 = f(x0,y0) = f(0,1)= 1
k2 = f(x0+h/2, y0+ 0.5k1h)= f(0+0.5/2, 1+ 0.5(1)0.5)
=f(.25,1.25)= 1.3680
k3 = f(x0+h/2, y0+ 0.5k2h)= f(0+0.5/2, 1+ 0.5(1.3680)0.5)
= f(.25,1.342)= 1.4084

15
k4 = f(x0+h, y0+ k3h) = f(0.5, 1+1.4084(.5))= f(0.5,1.7042)= 1.8055

y(0.5) = 1 + 1/6( 1 + 2(1.3680 ) +2(1.4084)+ 1.8055)0.5 = 1.6965

x1 = 0.5 y1 = 1.6965 f(x,y) = x + y1/2


k1 = f(x1,y1) = f(0.5,1.6965)= 1.8025
k2 = f(x1+h/2, y1+ 0.5k1h)= f(0.5+0.5/2, 1.6965+ 0.5(1.8025)0.5))
=f(.75,2.1471)=2.2153

k3 = f(x1+h/2, y1+ 0.5k2h)= f(0.5+0.5/2, 1.6965 + 0.5(2.2153)0.5)


= f(.75,.2.2503)= 2.2500
k4 = f(x1+h, y1+ k3h) = f(1, 2.8215)= 2.6797

y(1) = 1.6965 + 1/6( 1.8025 + 2(2.2153 ) +2(2.2500)+ 2.6797)(0.5) = 2.8142

16

You might also like