Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a Matlab script to calculate the second order derivative for the following

ID: 3404195 • Letter: W

Question

Write a Matlab script to calculate the second order derivative for the following: function: f(x) = 2^x/x for 1 lessthanorequalto x lessthanorequalto 26 a) Find f'(x) using second order scheme with h = (b-a)/12.5 for first calculation b) Find f'(x) using second order scheme with h = (b-a)/25 for second calculation c) Find f'(x) using Richardson 6^th order accuracy scheme for final results d) Find the relative error for the thee solutions at point x = 24 from part b) For plotting and for the relative error calculation in the three cases use the following analytical solution: f'(x) = 2^x(In 2)^2/x - 2 times 2^x(In 2)/x^2 + 2 times 2^x/x^3

Explanation / Answer

syms x

f=2^x / x

diff (f)

ans=(x*2^ x ln2 - 2^x) /x^2

diff

syms h

x = 2 : h : 26

ans=

syms h

x =1 : h : 26

ans =

diff f = f(x+h) -f(x-h) /2*h -h^2 /3!*diff(f,x,3) +h^4/5!diff(f,x,5)+....

ans =

diff f =2^x (ln2)^2/x - 2*2^x (ln2)/x^2 + 2*2^x/x^3

ans=

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote