38
Analytical Toolbox Analytical Toolbox Differential calculus Differential calculus By By Dr J.P.M. Whitty Dr J.P.M. Whitty

Analytical Toolbox Differential calculus By Dr J.P.M. Whitty

Embed Size (px)

Citation preview

Analytical ToolboxAnalytical Toolbox

Differential calculusDifferential calculus

ByBy

Dr J.P.M. WhittyDr J.P.M. Whitty

2

Learning objectivesLearning objectives

• After the session After the session youyou will be will be able able to:to:• Define the derivative in terms of a Define the derivative in terms of a

imitating function imitating function • Differentiate Differentiate simplesimple algebraic algebraic

functions from first principles functions from first principles • Apply rules of differentiationApply rules of differentiation• Use math software to solve Use math software to solve

simple differentiation problemssimple differentiation problems

3

Differential CalculusDifferential Calculus • Calculus Calculus isis the mathematics of the mathematics of

changechange A point in three dimensions needs six A point in three dimensions needs six pieces of information to be fully described.pieces of information to be fully described.

• We use the Derivative Function , We use the Derivative Function , ff , , to describe theto describe the rate of rate of change change of the of the original function original function ff. .

y

x

y = f x () f(a)

a+h a

f (a+h)

run

rise

y

x

y

x

y

x

f a

f a h f a

hh( ) lim

( ) ( )

0

4

ExampleExample

Find the derivative (using first Find the derivative (using first principles) of principles) of f f ((xx)) = x = x22 - - 88x + x + 9. Here 9. Here we use the definition:we use the definition:

f a

f a h f a

hh( ) lim

( ) ( )

0

Where: 9)(8)()( 2 hahahaf

9882)( 22 hahahahaf

Giving:

h

aahahahaaf

h

989882lim)('

222

0

5

Example Cont:Example Cont:

Simplifying the denominator:Simplifying the denominator:

h

hhahaf

h

82lim)('

2

0

h

aahahahaaf

h

989882lim)('

222

0

That is:

Cancel out the h’s

h

hhahaf

h

82lim)('

2

0

82lim)('0

haafh

:0 letting h 82)(' aaf

0

:)3(' gives 3let fa 14832)3(' f

6

Differentiation of Differentiation of standard functionsstandard functions

It is usual in calculus It is usual in calculus textbooks that to see textbooks that to see tables of standard tables of standard functions and their functions and their respective differential respective differential coefficients. coefficients.

• For this For this introductory introductory course you will course you will only require the only require the followingfollowing

ydx

dy

c 0

nax1nanx

axsin axa cos

axcos axa sin

axeax exp axaaeax exp

7

Class Examples TimeClass Examples Time

Copy and complete Copy and complete the following table.the following table. y

dx

dy

c5 0

x3 3

24x x845x 320x

123 3 xx 29 2 x

8

Class examplesClass examples

Differentiate the following:Differentiate the following:

0123 1722334 xxxxdx

dy

563) 34 xxxya 023 13643 xxxdx

dy

9723) 234 xxxxyb

7494) 23 xxxdx

dyans

11812) 23 xxdx

dyans

0123 17223344 xxxxdx

dy

9

Another exampleAnother example

Find the first and second derivatives of:Find the first and second derivatives of:

xexxxf x sin103cos98)(' 23

xexxxf x cos53sin32)( 24

xexxxf x cos203sin1824)('' 22

10

Class Examples TimeClass Examples Time

Find the first and Find the first and second derivative second derivative of: of:

xexxxxxf 3cos62sin26)9exp(18)('

xexxxxxf 3sin22cos3)9exp(2)( 2

xexxxxf 3sin182cos46)9exp(162)(''

11

Differentiation Differentiation FormulaeFormulae

Several ‘short-cut’ rules exist for differentiation, eliminating Several ‘short-cut’ rules exist for differentiation, eliminating the need for tedious and repetitive use of limit expressions. the need for tedious and repetitive use of limit expressions.

Proofs of these can be found in most calculus books.Proofs of these can be found in most calculus books.

Description Function Derivative Constant f (x) = c f x( ) 0

General Power Rule f (x) = xn f x nx n( ) 1

Addition/Subtraction f (x) = g (x) h (x)

f x g x h x( ) ( ) ( )

Product Rule

f (x) = g (x) h (x)

f x g x h x g x h x( ) ( ) ( ) ( ) ( )

Quotient Rule f (x) =

g x

h x

( )

( ) f x( )

g x h x g x h x

h x

( ) ( ) ( ) ( )

( ( ))2

12

Revision QuestionsRevision Questions

1.1. Complete Complete the following the following table:table:

ydxdy

cx

2x34x

4x52x

22 3 xx

13

More Revision QsMore Revision Qs

1.1. Differentiate the following:Differentiate the following:

2.2. Find the first and second Find the first and second derivatives of:derivatives of:

4252) 34 xxxya

15423) 234 xxxxyb

xexxxf x 4cos32sin43)( 3

xexxxxxf 43 74sin33cos22)4exp(9)(

14

Revision Qs (solutions)Revision Qs (solutions)

1.1. Complete Complete the following the following table:table:

ydxdy

cx

2x34x

4x52x

22 3 xx

01x2

212x34x

410x

16 2 x

15

More Revision Qs More Revision Qs (Solutions)(Solutions)

1.1. Differentiate the following:Differentiate the following:

2.2. The first and second derivativesThe first and second derivatives

2158 23 xxdx

dy

58612 23 xxxdx

dy

xexxxf x 4sin432cos89)(' 2

xexxxxxf 42 284cos123sin66)4exp(36)('

xexxxf x 4cos1632sin1618)(''

xexxxxxf 41124sin483cos1812)4exp(144)('

16

The Product rule:The Product rule:

This is used when we have two primitive This is used when we have two primitive functions multiplied together.functions multiplied together.

If uvxhxgxf )()()(

dx

duv

dx

dvuxhxgxhxgxf )()()()()(

then

17

The Product rule: The Product rule: ProofProof

Here we employ the definition of the Here we employ the definition of the derivative thus:derivative thus:

x

xhxgxxhxxgxf

x

)()()()(lim)('

0

Re-writing this gives

x

xhxgxxgxhxxgxhxxhxxg

xf

x

)()()()()()()()(lim

)('

0

x

xgxxgxh

x

xhxxhxxgxf

x

)()()(

)()()(lim)('

0

18

The Product rule: The Product rule: ProofProof

Now use the fact that the terms in parenthesis Now use the fact that the terms in parenthesis are derivatives of the individual functions, are derivatives of the individual functions, to complete the proof, i.e.:to complete the proof, i.e.:

)()(

lim)(' and )()(

lim)('00

x

xhxxhxh

x

xgxxgxg

xx

x

xgxxgxh

x

xhxxhxxgxf

x

)()()(

)()()(lim)('

0

Hence Substitution gives:

)(')()(')(lim)('0

xgxhxhxxgxfx

Evaluation of the limit renders the required result

19

The Product rule: The Product rule: Proof (Alternative Proof (Alternative nomenclature)nomenclature)

In many calculus text books, the less In many calculus text books, the less formalformal functions of functions of uu and and vv are used. This makes the are used. This makes the preceding proof a little less tedious, as preceding proof a little less tedious, as followsfollows

If

x

uvvvuuxf

x

))((lim)('

0thenuvxf )(

x

uvvuvuuvuvxf

x

)(lim)('

0

x

vu

x

vu

x

uv

x

vuvuuvxf

xx

00limlim)('

dx

duv

dx

dyu

x

vu

x

uvxf

xx

00limlim)('

0

20

Lemma 1:Lemma 1:

When using the calculus we rarely When using the calculus we rarely resort to using formulae, we tend to resort to using formulae, we tend to remember a mechanism of a pattern, remember a mechanism of a pattern, these leads us to the lemma. these leads us to the lemma.

Lemma 1:The first times the diff. of the second-plus-the second times the diff. of the first

21

ExampleExample

If find If find xexy 53 dx

dy

First Second

3xdx

dy

Diff of the second

xe55 xe55

Diff of the first

22

Another Example:Another Example:

)3cos(2 xey xIf finddx

dy

xx exxedx

dy 22 2)3cos())3sin(3(

Ans: )3cos(2)3sin(3 22 xexedx

dy xx

23

if

The quotient rule:The quotient rule:

v

u

xh

xgxf

)(

)()(

This is used when we have two primitive functions This is used when we have two primitive functions dividend by one anotherdividend by one another

Then 2)(

)(')()(')()('

xg

xhxgxgxhxf

or2v

dxdv

udxdu

v

dx

dy

24

Lemma 2:Lemma 2:

AgainAgain we tend to remember a mechanism we tend to remember a mechanism of a pattern, this leads us to the lemma. of a pattern, this leads us to the lemma.

Lemma 1:The bottom times the diff. of the top-minus-the top times the diff. of the bottom – ALL OVER THE BOTTOM SQUARED

In a sense this isIn a sense this is simply the reverse of the product simply the reverse of the product rule and then dividing by the square of the bottom! rule and then dividing by the square of the bottom!

25

ExampleExample

If find If find xexy 53 / dx

dy

bottom top

xedx

dy 5

Diff of the top

23x xex 53 5

Diff of the bottom

25xe

bottom squared

x

xx

e

xexe

dx

dy10

3525 53

xe

xx5

2 53

26

Alternative approachAlternative approach

An alternative approach is to use An alternative approach is to use logarithmic differentiation as follows:logarithmic differentiation as follows:

xexy 53 / Take logs xxy 5ln3ln

Differentiate using the chain rule as appropriate:

xxy 5ln3ln

5

35

3

xe

x

dx

dyx

xe

xx

dx

dy5

2 53

27

Alternative approachAlternative approach

The logarithmic approach is especially The logarithmic approach is especially useful when the primitive functions useful when the primitive functions are themselves products (or are themselves products (or quotients), the details of the method quotients), the details of the method are left to P7 of the recommended are left to P7 of the recommended reading. But here we shall consider reading. But here we shall consider another quick example, i.e.:another quick example, i.e.:

dx

dy

x

xxy find

1

1 if

2

3

28

Logarithmic differentiationLogarithmic differentiation

The approach is always the same take The approach is always the same take natural logs, remembering ever natural logs, remembering ever primitive above the line is positive primitive above the line is positive and everything below is negative. and everything below is negative. Then differentiate the resulting Then differentiate the resulting primitive functions, remembering primitive functions, remembering that the RHS is equal to the 1/y that the RHS is equal to the 1/y multiplied by the differential multiplied by the differential coefficient. The rest is just algebra! coefficient. The rest is just algebra!

29

Logarithmic differentiation Logarithmic differentiation ExampleExample

Taking logs of both sides gives:Taking logs of both sides gives:

23 1ln1lnlnln xxxy

Differentiate:Differentiate:

23

3

1

2

1

311

x

x

x

x

xdx

dy

y

Substitute: Substitute:

23

3

2

3

1

2

1

31

1

1

x

x

x

x

xx

xx

dx

dy

30

Use of mathematic Use of mathematic SoftwareSoftware

As the expressions get more and As the expressions get more and more complicated the methods more complicated the methods stay the same but the algebra stay the same but the algebra gets more and more tedious. gets more and more tedious. Thankfully these days MATLAB has Thankfully these days MATLAB has the answer that is the symbolic the answer that is the symbolic toolbox we have been using in toolbox we have been using in previous lessons can be used to previous lessons can be used to differentiate complicated functions differentiate complicated functions such as that in the last example.such as that in the last example.

31

MATLAB: MATLAB: Differentiation Differentiation

The process is the same as usual. i.e. easy as ABC!

)pretty(ans

diff(y)

)2^1/())3^1(*(y

y x syms

:Commands MATLAB

xxx

A. Set up your symbolics in MATLAB using the syms command

B. Type in the expression remembering the rules of BIDMAS

C. Use the appropriate MATLAB function in this case diff( ), making pretty if required.

dx

dy

x

xxy find

1

1 if

2

3

32

MATLAB SolutionMATLAB Solution

The commands The commands are very straight are very straight forward but you forward but you may have to do may have to do a little bit of a little bit of algebra at the algebra at the end to get the end to get the result in the result in the same form same form alternatively use alternatively use the MATLAB the MATLAB commands to do commands to do it for you!!it for you!!

33

MATLAB Solution cont…MATLAB Solution cont…

For instance try For instance try factorizing factorizing the resulting the resulting expression expression using the using the factorfactor function we function we have used in have used in class class previously, previously, thusthus

34

SummarySummary

Have we met our learning objectives?Have we met our learning objectives?Specifically:Specifically: are you able to: are you able to:

• Define the derivative in terms of a Define the derivative in terms of a imitating function imitating function

• Differentiate Differentiate simplesimple algebraic algebraic functions from first principles functions from first principles

• Apply rules of differentiationApply rules of differentiation• Use math software to solve simple Use math software to solve simple

differentiation problems differentiation problems

35

HomeworkHomework

1.1. Find the derivative ofFind the derivative of

2. Find the derivative of 2. Find the derivative of

3. Find the derivative of3. Find the derivative of

x x x3 22 5 6

( )( )x x x x5 2 36 2 1

x

x

2

21

1

36

Examination type Examination type questionsquestions

1. Differentiate the following with 1. Differentiate the following with respect to x. respect to x.

a.a.

b.b.

c.c.

d.d. Explain how you would use Explain how you would use mathmath software to verify your resultssoftware to verify your results

xe x 2cos4

)ln(cos xxe x 2sin/3

37

Examination type Examination type questionsquestions

2. Evaluate the tangent to the curve 2. Evaluate the tangent to the curve

at a point P(2,6) and find the equation of at a point P(2,6) and find the equation of the tangent of that line. Given that the tangent of that line. Given that the product of the normal and the product of the normal and tangential line gradients is minus tangential line gradients is minus unity find the equation of the normal.unity find the equation of the normal.

xxxy 32 23

38

More CalculusMore Calculus

WELL DONE!!WELL DONE!!

You have now completed the first part You have now completed the first part of this of this learning packlearning pack. Have a break . Have a break and then you can try the next part and then you can try the next part where you will be introduced to the where you will be introduced to the inverse process to differentiation, inverse process to differentiation, namely:namely:

IntegrationIntegration