{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

a1_09s

# a1_09s - or(b 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 1 2 3 4 5...

This preview shows pages 1–3. Sign up to view the full content.

DALHOUSIE UNIVERSITY (Department of Engineering Mathematics) AM-3052 Numerical Methods and Linear Algebra ASSIGNMENT #1 Due: Sept 22, 2009 1. Consider the function ) sin( ) ( 2 x e x f x = : (a) Find the Taylor series expansion of ) ( x f about 0 = x to ) ( 6 x O . (b) Graph the above function in (a) along with their Taylor approximations (different plot for one term, two terms etc ) on the same set of axis using Matlab on the interval 2 0 x and 10 0 y . 2. Write a Matlab program that will use the Taylor series expansion to calculate the value of ) 1 . 0 ( f where ) sin( ) ( 2 x x x f = accurate to 8 decimal places.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
SOLUTIONS: 1. (a) Taylor series for 2 x e = Taylor series for ) sin( x = Therefore Taylor series for ) sin( 2 x e x = product of above two polynomials
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: or (b) 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 1 2 3 4 5 6 7 8 9 10 x-axis f(x)=exp(x 2 )*sin(x) Taylor Series Approximations Function One Term Two Terms Three Terms 2. clc; clear; x=.1; oldterm = x^3; newterm = -(x^5)/6; oldsum = oldterm; newsum = oldsum + newterm; n=2; while (abs(oldsum -newsum)>10^-8) oldsum = newsum; oldterm = newterm; newterm = oldterm*(-x^2)/(2*n+1); newsum = oldsum + newterm; n=n+1; end fprintf( 'The approx value of f(x) is %10.8f\n' ,oldsum) fprintf( 'The exact value of f(x) is %10.8f\n' ,x^2*sin(x)) OUTPUT SCREEN: The approx value of f(x) is 0.00099833 The exact value of f(x) is 0.00099833...
View Full Document

{[ snackBarMessage ]}

### Page1 / 3

a1_09s - or(b 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 1 2 3 4 5...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online