It is a useful program for doing symbolic algebra

Info icon This preview shows pages 2–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Mathematica isn’t covered in this class, it may be useful to see what it can do easily. It is a useful program for doing symbolic algebra, manipulating lists, and for employing a variety of common mathematical functions without having to write too much code. Of course for this problem you could also have written some MATLAB code to accomplish more or less the same thing, or written out more steps by hand. In[389]:= Binomial[0.25, 2] Out[389]= -0.09375 In[390]:= Binomial[0.25, 3] Out[390]= 0.0546875 In[391]:= Binomial[0.25, 4] Out[391]= -0.0375977 In[379]:= f = {1.0, 1.22140, 1.49182, 1.82212, 2.22554} Out[379]= {1., 1.2214, 1.49182, 1.82212, 2.22554} In[383]:= Df = Table[f[[i + 1]] - f[[i]], {i, 4}] Out[383]= {0.2214, 0.27042, 0.3303, 0.40342} In[385]:= DDf = Table[Df[[i + 1]] - Df[[i]], {i, 3}] Out[385]= {0.04902, 0.05988, 0.07312} In[387]:= DDDf = Table[DDf[[i + 1]] - DDf[[i]], {i, 2}] Out[387]= {0.01086, 0.01324} In[388]:= DDDDf = Table[DDDf[[i + 1]] - DDDf[[i]], {i, 1}] Out[388]= {0.00238}
Image of page 2

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

View Full Document Right Arrow Icon
MATH 128A, SUMMER 2010, HOMEWORK 5 SOLUTION 3 16. For a function f , the Newton divided-difference formula gives the interpolating polynomial P 3 ( x ) = 1 + 4 x + 4 x ( x - 0 . 25) + 16 3 x ( x - 0 . 25)( x - 0 . 5) , on the nodes x 0 = 0, x 1 = 0 . 25, and x 3 = 0 . 75. Find f (0 . 75). solution: Since the interpolating polynomial agrees with f at the x i and we are asked to find f ( x 3 ), it suffices to compute P 3 ( x 3 ). We get P 3 (0 . 75) = 1 + 4(0 . 75) + 4 · 0 . 75 · (0 . 75 - 0 . 25) + 16 3 · 0 . 75(0 . 75 - 0 . 25)(0 . 75 - 0 . 5) = 6. section 3.3 2. Use Theorem 3.9 or Algorithm 3.3 to construct an approximating polynomial for the follow- ing data. a. x f ( x ) f 0 ( x ) 0 1.00000 2.00000 0.5 2.71828 5.43656 solution: I will use Theorem 3.9. It says the Hermite polynomial is given by the formula H 2 n +1 ( x ) = n j =0 f ( x j )[1 - 2( x - x j ) L 0 n,j ( x )] L 2 n,j ( x )+ n j =0 f 0 ( x j )( x - x j ) L 2 n,j ( x ). In our case n = 1 and there are only two points x 0 = 0 and x 1 = 0 . 5. The formula becomes H 3 ( x ) = f ( x 0 )[1 - 2( x - x 0 ) L 0 1 , 0 ( x )] L 2 1 , 0 ( x ) + f ( x 1 )[1 - 2( x - x 1 ) L 0 1 , 1 ( x )] L 2 1 , 1 ( x ) + f 0 ( x 0 )( x - x 0 ) L 2 1 , 0 ( x ) + f 0 ( x 1 )( x - x 1 ) L 2 1 , 1 ( x ) L 1 , 0 ( x ) = x - x 1 x 0 - x 1 = x - 0 . 5 - 0 . 5 = - 2 . 00000( x - 0 . 5) L 2 1 , 0 ( x ) = 4 . 00000( x - 0 . 5) 2 L 0 1 , 0 ( x ) = - 2 . 00000 L 1 , 1 ( x ) = x - x 0 x 1 - x 0 = x - 0 0 . 5 = 2 x L 2 1 , 1 ( x ) = 4 x 2 L 0 1 , 1 ( x ) = 2 So H 3 ( x ) = 1 . 00000[1 - 2 x ( - 2 . 00000)]4 . 00000( x - 0 . 5) 2 + 2 . 71828[1 - 2( x - 0 .
Image of page 3
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern