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

Post on 14-Dec-2015

254 views 8 download

Tags:

transcript

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.

3

Differentiation: Definition

Definition

Differentiation by Definition

4

Functions and Expressions

On Functions On Expressions

5

Multiple Derivatives

Derivative of Symbolic Functions

Multiple Derivatives

Hold actual evaluations

$: Sequence Operator

6

Value of Derivative at a Point

Functions

Expressions

7

Multivariate Functions

8

Multivariate Functions (cont.)

Partial Derivatives on x and y

Partial Derivatives on 1st variable

Partial Derivatives on 1st and 2nd variables

9

Jacobian

Partial derivatives

( , , )

( , , )

x y zJ

r u v

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)

11

Exercise

De l’Hospital’s rule states that

Compute by applying this rule

interactively. Use the function limit to check

your result.

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.

13

Limit

Limit

14

Left and Right Limit

15

Other Limits

Conditional Limits

Intervals

16

Exercise

Use MuPAD to verify the following limits:

17

Integration

Definite and Indefinite Integrations

18

Numeric Integration

No Symbolic Solution

19

Integration with Real Parameters

Use assume to set attributes of parameters.

20

Exercise

Compute the following integrals:

Use MuPAD to verify the following equality:

21

Exercise

Use MuPAD to determine the following indef-inite integrals:

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.

23

Sum of Series

24

Exercise Use MuPAD to verify the following identity:

Determine the values of the following series:

25

Calculus Example

Asymptotes, Max, Min, Inflection Point

Look at the overall characteristicsof the function.

26

Asymptotes

Horizontal

Vertical

27

Min and Max

Roots of the Derivative

28

Inflection Point

Roots of the Second Derivative

29

Putting All Together

Display the findings about the function.

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.

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)

32

Notes