{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw4_solns

# hw4_solns - Mathematics of Engineering ME17 Spring 2007...

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

Mathematics of Engineering - ME17 Spring 2007 Homework #4 - Solutions 1. (10 points total) (a) (3 pts) To compute the first three terms for the Taylor series of f ( x ) = sin( x ) about the point x = π/ 4, consider the general equation for a Taylor series about the point a f ( x ) = f ( a ) + f 0 ( a )( x - a ) + f 00 ( a ) 2! ( x - a ) 2 + · · · . (1) Substituting f ( x ) = sin( x ) and a = π/ 4 into (1) we obtain f ( x ) = sin π 4 + cos π 4 x - π 4 - 1 2 sin π 4 x - π 4 2 + · · · . Simplifying and only keeping the first three terms we get f ( x ) = 2 2 + 2 2 x - π 4 - 2 4 x - π 4 2 . (2) (b) (3 pts) For this problem, we need to plot f ( x ) , f 0 ( x ) , f 1 ( x ) , and f 2 ( x ), which are given by f ( x ) = sin( x ) , (3) f 0 ( x ) = 2 2 , (4) f 1 ( x ) = 2 2 + 2 2 x - π 4 , (5) f 2 ( x ) = 2 2 + 2 2 x - π 4 - 2 4 x - π 4 2 . (6) The m.file and corresponding plot showing all four functions are given below. 1

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

View Full Document
% ***************************************** % % Problem 1( b ) % % ***************************************** % x = 0 : 0.1 : 2 ; f = sin ( x ) ; f0 = sqrt (2)/2 + ( x - x ) ; % The (x - x ) term i s added here to make f0 a vector f1 = f0 + sqrt (2)/2 * ( x - pi / 4 ) ; f2 = f1 - sqrt (2)/4 * ( x - pi / 4 ) . ˆ 2 ; hold on ; % Holds current p l o t plot (x , f ) plot (x , f0 , ’ -- ’ ) plot (x , f1 , ’ - . ’ ) plot (x , f2 , ’ : ’ ) xlabel ( ’ x ’ ) ; legend ( ’ f ( x ) ’ , ’ f 0 ( x ) ’ , ’ f 1 ( x ) ’ , ’ f 2 ( x ) ’ ) ; t i t l e ( ’ Taylor S e r i e s Length Comparison ’ ) ; 0 0.5 1 1.5 2 -0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 x Taylor Series Length Comparison f(x) f 0 (x) f 1 (x) f 2 (x) Figure 1: Problem 1b. 2
(c) (2 pts) Here we solve f 1 ( x ) = 0 for x which gives an approximation for where f ( x ) = 0. f 1 ( x ) = sin π 4 + cos π 4 x - π 4 (7) 0 = sin π 4 + cos π 4 x - π 4 0 = 1 + x - π 4 x = π 4 - 1 x = - 0 . 2146 . (8) (d) (2 pts) Solving for f 2 ( x ) = 0 we obtain f 2 ( x ) = sin π 4 + cos π 4 x - π 4 - 1 2 sin π 4 x - π 4 2 (9) 0 = sin π 4 + cos π 4 x - π 4 - 1 2 sin π 4 x - π 4 2 0 = 1 - x - π 4 - 1 2 x - π 4 2 0 = 1 2 x 2 + - π 4 - 1 x + π 2 32 + π 4 - 1 (10) Using the quadratic formula, where x = - b ± b 2 - 4 ac 2 a , (11) and from (10) a = 1 2 , b = - π 4 - 1 , c = π 2 32 + π 4 - 1 ,

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 8

hw4_solns - Mathematics of Engineering ME17 Spring 2007...

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

View Full Document
Ask a homework question - tutors are online