The Taylor series of function f expanded around x = a is def taylor2(f,a): f(n) (a)...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
The Taylor series of function f expanded around x = a is def taylor2(f,a): f(n) (a) (x − a)" f(x) = n! Write a function that returns the 2nd-order Taylor series expansion of an aribtrary function. Your function should take 2 arguments-the mathematical function f and the expansion point a-and return a function that takes 1 argument-the input x. Use the functions df and df2 that you wrote previously. The general structure should be: # your code goes here Use your function to evaluate the following: n=0 ≈ ƒ(a) + ƒ'(a)(x − a) + ƒ" (a) (x − a)² a) sin(0.5) and sin(0.75) using a 2nd-order taylor series of sin(x) expanded around x = 0 b) log(0.8) and log(1.2) using a 2nd-order taylor series of log(x) expanded around x = 1 Sample output your code should generate is: The numerical value of sin (0.5) is 0.500000 The exact value of sin(0.5) is 0.479426 The relative error is 0.04291 The Taylor series of function f expanded around x = a is def taylor2(f,a): f(n) (a) (x − a)" f(x) = n! Write a function that returns the 2nd-order Taylor series expansion of an aribtrary function. Your function should take 2 arguments-the mathematical function f and the expansion point a-and return a function that takes 1 argument-the input x. Use the functions df and df2 that you wrote previously. The general structure should be: # your code goes here Use your function to evaluate the following: n=0 ≈ ƒ(a) + ƒ'(a)(x − a) + ƒ" (a) (x − a)² a) sin(0.5) and sin(0.75) using a 2nd-order taylor series of sin(x) expanded around x = 0 b) log(0.8) and log(1.2) using a 2nd-order taylor series of log(x) expanded around x = 1 Sample output your code should generate is: The numerical value of sin (0.5) is 0.500000 The exact value of sin(0.5) is 0.479426 The relative error is 0.04291
Expert Answer:
Answer rating: 100% (QA)
To create a Python function that returns the 2ndorder Taylor series expansion of an arbitrary functi... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
What is an assessment center (AC)? What kind of exercises or activities can be included in an AC? Explain.
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
a) A male tennis player stands 6 feet 8 inches (6'8") tall in tennis shoes. When holding his arms outstretched in the horizontal plane, the centre of his hands are 6'8" apart, his shoulder height is...
-
For the inexperienced marketer, the similar-but-different aspect of culture creates an illusion of similarity that usually does not exist. Discuss and give examples.
-
A pressure cylinder has a diameter of 150 mm and has a 6-mm wall thickness. What pressure can this vessel carry if the maximum shear stress is not to exceed 25 Mpa?
-
The trial balance columns of the worksheet for Barbosa Company, SA at June 30, 2017, are as follows. Other data: Operating expenses incurred on account, but not yet recorded, total R$1,640....
-
In a random sample of 300 male professionals it is found that 40% play golf, 60% play soccer and 30% play both golf and soccer. Find the probability that a person selected at random from this sample...
-
The heat evolved in calories per gram of a cement mixture is approximately normally distributed. The mean is thought to be 100 and the standard deviation is 2. We wish to test versus with a sample of...
-
If individual values that underline ethics are developed at a young age, what might this suggest about the potential for ethical conflicts to arise within an organization?
-
Beacons Company maintains and repairs warning lights, such as those found on radio towers and lighthouses. Beacons Company prepared the following end-of-period spreadsheet at December 31, 20Y5, the...
-
Write a learning essay on self-assessment. The goals of the essay are to: - reflect on the suggested readings; - describe and explain the process of self-assessment; - discuss theoretical and...
-
Watch a TV performer, or listen to a radio performer/podcast, or review an online performer (news, entertainment news, sports news, music news, or another performer who informs) No comedians or...
-
Write the update formula using Newton's method to find root of f (x) x - log (x) = Xn+1 = Xn Xn+1 = Xn Xn+1 = In + In+1 = Xn x - log (n) 2xn In x - log (n) 2xn - In In x - log (n) 1 2xn In x - log...
-
Complete the table. Summary of Answers. Solution is required. Installment Sales Cost of Installment Sales 2015 2016 2017 500,000 800,000 800,000 Gross Profit Gross Profit Rate on Sales Gross Profit...
-
Identify the one Interpersonal Style that describes people who bother you the most and with whom you have challenges communicating with. a. Why do you think this Interpersonal Style is so challenging...
-
Draft a letter to the publisher of the Victoria Advocate inviting the newspaper to host a public forum on Acme's proposed tank farm. For an Acme Petroleum letterhead, make up a mailing address,...
-
Problem-Solving Strategy 26.2 for continuous charge distribution problems. A straight wire of length L has a positive charge Q distributed along its length. Find the magnitude of the electric field...
-
Fill in each blank so that the resulting statement is true. A solution to a system of linear equations in two variables is an ordered pair that__________ .
-
Apply Euler's Method to the equation y ' = y, y(0) = 1 with an arbitrary step size h = 1/N where N is a positive integer. (a) Derive the relationship yn = y0 (1+h)n (b) Explain why yN is an...
-
Suppose that the temperature T on the circular plate {(x, y}: x2 + y2 ( 1} is given by T = 2x2 + y2 - y. End the hottest and coldest spots on the plate.
-
Use the table of integrals to evaluate the following integrals. (a) (81-4x2)/x dx (b) ex(9-e2x)3/2 dx
-
The treatment of outflows on account of dividend and interest is highly debatable as to their activity classification. Give a serious thought to the issue and express your opinion about the best...
-
Reliance Industries Ltd. is the biggest private sector company in India. The following fact sheet about the company and its peer group, as extracted from Capitaline Plus database is reproduced in the...
-
Consider the same setting as Problem 18, but suppose instead 80% of the shareholders redeem their shares, and no warrants are exercised. Data from problem 18 a. What is the amount of cash per share...
Study smarter with the SolutionInn App