Math Review with Matlab: Calculus Taylors Series S. Awad, Ph.D. M. Corless, M.S.E.E. D. Cinpinski E.C.E. Department University of Michigan-Dearborn Calculus: Taylor Series Math Review with Matlab U of M-Dearborn ECE Department Series Operations Symbolic Summation Taylor Series Taylor Command

Taylor Series Example Approximation and Comparison Example 2 Calculus: Taylor Series Math Review with Matlab U of M-Dearborn ECE Department Symbolic Summation Find the sum of the following series s1 and s2 if they converges Example 1: 1 S1 2 x 1 x

Example 2 4x2 x 3 S 2 3 x 2x x 1 s1=symsum(1/x^2,1,inf) s1 = Converges 1/6*pi^2 num = 4*x*x-x-3 den = x^3+2*x s2=symsum(num/den,1,inf) s2 = Diverges! inf 3 Calculus: Taylor Series Math Review with Matlab

U of M-Dearborn ECE Department Summation Examples Example 3: s3=symsum(1/(x-1.5)^2,1,inf) s3 = 4+1/2*pi^2 eval(s3) ans = 8.9348 Example 4: S 3 x 1 1 x 3

2 2 s4=symsum((1/x)*(-1)^(x+1),1,inf) s4 = log(2) 1 x 1 S 4 1 x 1 x eval(s4) ans = 0.6931 4 Calculus: Taylor Series Math Review with Matlab U of M-Dearborn ECE Department Finite Summation Example

Example 5: N 1 2 S 5 x 1 x 3 N 2 N 15 N 31 6 x 1 syms x N; s5=symsum((x+3)*(x+1),1,N) s5 = 7/6*N-11/6+3/2*(N+1)^2+1/3*(N+1)^3 s5=simple(s5) s5 = 1/6*N*(31+15*N+2*N^2) 5 Calculus: Taylor Series Math Review with Matlab

U of M-Dearborn ECE Department Taylor Series Taylor Series approximation is defined as: f t ( x ) x a n n 0 f n (a) n! MacLaurin Series is the Taylor series approximation with a=0:

ft x n 0 n f n ( 0) n! 6 Calculus: Taylor Series Math Review with Matlab U of M-Dearborn ECE Department Taylor Command taylor(f) is the fifth order MacLaurin polynomial

approximation to f taylor(f,n) is the (n -1)-st order MacLaurin polynomial taylor(f,n,a) is the Taylor polynomial approximation about point a with order (n -1). 7 Calculus: Taylor Series Math Review with Matlab U of M-Dearborn ECE Department Taylor Series Example Given the function: f x ln 1 x 1) Find the first 6 Taylor Series Terms (a=0) 2) Find the first 4 terms about the point a=2 sym x; f=log(1+x) % Matlab's Natural Log f = log(1+x)

8 Calculus: Taylor Series Math Review with Matlab U of M-Dearborn ECE Department Taylor Series Terms Find the first 6 Taylor Series Terms (a=0) taylor(f) %Default is 5th order ans = x-1/2*x^2+1/3*x^3-1/4*x^4+1/5*x^5 Find the first 4 terms about the point a=2 Note that this is 3rd order taylor(f,4,2) ans = log(3)+1/3*x-2/3-1/18*(x-2)^2+1/81*(x-2)^3 9 Calculus: Taylor Series

Math Review with Matlab U of M-Dearborn ECE Department Taylor Series Approximation and Comparison Example Given the function: 1 f x 5 4 cos x 1) Plot f(x) from -2 to 2 2) Find the first 8 Taylor Series Terms (a=0) 3) Plot the approximation and compare against the original function f(x) 10 Calculus: Taylor Series Math Review with Matlab U of M-Dearborn ECE Department Plot f(x)

The easiest way to generate a graph is to use ezplot ezplot leaves the axes unlabeled syms x f=1/(5+4*cos(x)); ezplot(f,-2*pi,2*pi); grid on xlabel('x');ylabel('f(x)') 11 Calculus: Taylor Series Math Review with Matlab U of M-Dearborn ECE Department Plot of f(x) 12

Calculus: Taylor Series Math Review with Matlab U of M-Dearborn ECE Department Taylor Approximation To find the first 8 terms of the Taylor series approximation: ft_8=taylor(f,8) ft_8 = 1/9+2/81*x^2+5/1458*x^4+49/131220*x^6 1 2 x 2 5x 4 49 x 6 ft 9 81 1458 131220 13 Calculus: Taylor Series Math Review with Matlab U of M-Dearborn ECE Department

Comparison Plot approximation: hold on ezplot(ft_8) axis([-2*pi 2*pi 0 5]) Approximation is only good for small x Taylor approximation Original f(x) 14 Calculus: Taylor Series Math Review with Matlab U of M-Dearborn ECE Department Summary

The symbolic toolbox can be used to analyze definite and indefinite series summations Taylor series can be used to approximate functions MacLaurin series is a special case of the Taylor series approximated around x=0 Increase the number of terms to increase approximation accuracy 15

## Recently Viewed Presentations

• About MTH 132. Sections of 30-40 students. Typically 40 sections in Fall. Typically 20 sections in Spring. Instructors include: GTAs, Postdocs, and Faculty
• MAC Sublayer is responsible for deciding who sends next on a multi-access link. An important part of the link layer, especially for LANs. Physical. Link. Network. Transport. Application. MAC is in here. Gray units can be optionally omitted without causing...
• OpenGraphics Library, bilgisayar grafikleri görüntülenmesinde (rendering) kullanılan düşük seviyeli bir uygulama programlama arayüzüdür.. Kendisi ile temel geometrik ve görüntü bileşenleri kullanarak yüksek kaliteli görüntüler oluşturulabilmektedir. Pek çok grafik uygulamasının temelinde vardır.
• Note to User: We invite you to use this presentation to encourage others to adopt a Zero Suicide framework. We have included speaking points in the notes section below each slide. ... 30% saw a mental health professional. ... A...
• Transport Mechanism Other Proteins AIP,.. hsp90 Modes of Action of Dioxin * Toxic Effects of Dioxins Lethality Wasting Gonadal/Lymphoid Atrophy Hyperplasia Metaplasia Endocrine disruption Carcinogenicity Reproductive/ Developmental toxicity Dermal toxicity Immunotoxicity Neurotoxicity Hepatic toxicity Cardiovascular toxicity Multiple effects in ...
• These are behaviors prohibited either because they give a student an unfair advantage or because they compromise the secure administration of the assessments. Whether intentional or by accident, failure to comply with security rules, either by staff or students, constitutes...
• Learning. Learning. is a lasting change in behavior or mental process as the result of an experience. There are two important parts: a lasting change…a simple reflexive reaction is not learning. learning regarding mental process is much harder to observe...
• powerpoint template. Agenda ... Box Infographic. Put a relevant subtitle in this line. Content 2. Lorem ipsum dolor sit amet consectetursagitis purus dolor sit amet consectetursagitis. ... Segmented Pyramid Chart. Put a relevant subtitle in this line.