Question: USE MATLAB! USE MATLAB! QUESTION 2: The quadratic approximation of a function f(x) with its Maclaurin polynomials is given as follow: T(x)= f(0)+ L'Or+fO) 1!

USE MATLAB!

USE MATLAB! USE MATLAB! QUESTION 2: The quadratic approximation of a function

USE MATLAB!

QUESTION 2: The quadratic approximation of a function f(x) with its Maclaurin polynomials is given as follow: T(x)= f(0)+ L'Or+f"O) 1! 2! Based on the definition of derivative, the first and second derivative of a function f(x) are defined by (1) and (2) respectively. S'(x)=, lim, f(x+k)-f(x) (1) k f"(x)=, lim f'(x +k)- f'(x) f(x+k)-2f(x)+ f(x-k) lim (2) k k? Write a function diff12 that returns the coefficients of T(x). The function will receive 2 input arguments: the mathematical function (f) and the value k. Start with the function definition shown below. Use function handle to test "diff12. Other built-in functions and loops can be used if necessary. function [ output ] = diff12 (f, k) $ [OUTPUT] = DIFF12 (F,K) returns the coefficients of the Maclaurin % polynomials of f(x) end For example, if we use function handle to call the built-in cos function with k = 0.0001, we will see the following outputs: >> y = diff12 (@cos, 0.0001) Y = 1.0000 -0.0000 -0.5000

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!