chapter 11: symbolic computing for calculus matlab for scientist and engineers using symbolic...

32
Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

Upload: simon-ghrist

Post on 14-Dec-2015

268 views

Category:

Documents


8 download

TRANSCRIPT

Page 1: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

Chapter 11:

Symbolic Computing for Calculus

MATLAB for Scientist and Engineers

Using Symbolic Toolbox

Page 2: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

2

You are going to See that MuPAD does calculus as we do Analyze functions by their plots, limits and

derivatives Be glad that MuPAD does all complex inte-

grations and differentiation for you.

Page 3: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

3

Differentiation: Definition

Definition

Differentiation by Definition

Page 4: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

4

Functions and Expressions

On Functions On Expressions

Page 5: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

5

Multiple Derivatives

Derivative of Symbolic Functions

Multiple Derivatives

Hold actual evaluations

$: Sequence Operator

Page 6: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

6

Value of Derivative at a Point

Functions

Expressions

Page 7: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

7

Multivariate Functions

Page 8: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

8

Multivariate Functions (cont.)

Partial Derivatives on x and y

Partial Derivatives on 1st variable

Partial Derivatives on 1st and 2nd variables

Page 9: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

9

Jacobian

Partial derivatives

( , , )

( , , )

x y zJ

r u v

Page 10: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

10

Exercise

Consider the function f : x → sin(x) /x. Com-pute first the value of f at the point x = 1.23, and then the derivative f′(x).

Why does the following input not yield the de-sired result?

f := sin(x)/x: x := 1.23: diff(f, x)

Page 11: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

11

Exercise

De l’Hospital’s rule states that

Compute by applying this rule

interactively. Use the function limit to check

your result.

Page 12: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

12

Exercise

Determine the first and second order partial derivatives of f1(x1, x2) = sin(x1 x2) .

Let x = x(t) = sin(t), y = y(t) = cos(t), and

f2(x, y) = x2 y2.

Compute the derivative of f2(x(t), y(t)) with re-spect to t.

Page 13: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

13

Limit

Limit

Page 14: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

14

Left and Right Limit

Page 15: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

15

Other Limits

Conditional Limits

Intervals

Page 16: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

16

Exercise

Use MuPAD to verify the following limits:

Page 17: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

17

Integration

Definite and Indefinite Integrations

Page 18: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

18

Numeric Integration

No Symbolic Solution

Page 19: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

19

Integration with Real Parameters

Use assume to set attributes of parameters.

Page 20: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

20

Exercise

Compute the following integrals:

Use MuPAD to verify the following equality:

Page 21: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

21

Exercise

Use MuPAD to determine the following indef-inite integrals:

Page 22: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

22

Exercise The function intlib::changevar performs a change

of variable in a symbolic integral. Read the correspond-ing help page. MuPAD cannot compute the integral

Assist the system by using the substitution t = sin(x). Compare the value that you get to the numerical result returned by the function numeric::int.

Page 23: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

23

Sum of Series

Page 24: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

24

Exercise Use MuPAD to verify the following identity:

Determine the values of the following series:

Page 25: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

25

Calculus Example

Asymptotes, Max, Min, Inflection Point

Look at the overall characteristicsof the function.

Page 26: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

26

Asymptotes

Horizontal

Vertical

Page 27: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

27

Min and Max

Roots of the Derivative

Page 28: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

28

Inflection Point

Roots of the Second Derivative

Page 29: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

29

Putting All Together

Display the findings about the function.

Page 30: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

30

Key Takeaways

Now, you are able to find limit with optional left, and right approaches, get derivatives of functions and expressions, analyze functions by finding their asymptotes,

maxima and minima, and to get definite and indefinite integrals of arbi-

trary functions.

Page 31: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

31

Notes

limit(f(x),x=infinity) diff(sin(x^2)^2,x)

diff(sin(x^2)^2,x $ 3)

hold(expr)

reset()f := x -> x^2*sin(x)

f'(x) PIlimit(1/x, x=0, Right)

int(sin(x),x=0..PI) int(x^n,x) assuming n <> -1assume(a>0)

sum(k^2,k=1..n) simplify(expr)sum(x^n/n!,n=0..infinity

numer(expr) op(sol,[2,1,1])solve(expr)

plot::Line2d([x1,y1],[x2,y2]) plot::PointList2d( [[x1,x2],..])

D([1,2],f)

denom(expr)

Page 32: Chapter 11: Symbolic Computing for Calculus MATLAB for Scientist and Engineers Using Symbolic Toolbox

32

Notes