# Solve Trigonometric Functions Using MATLAB

Question

Consider the function, Approximate the first derivative of f(x = 4) using the first order accurate forward difference, second-order accurate central difference, and fourth-order accurate central difference

( f’i = (fi-2  - 8 fi-1 + 8fi+1 – fi+2) / (12h)  + O (h4) formulas. Compare the numerical approximation to the exact analytical derivative using grid spacings of h = 1, 0.1, 0.01, 0.001, and 0.0001 by plotting the error (defined as the absolute value of the difference from the exact derivative) versus the grid spacing. Use log-log axes and confirm the order of accuracy of each of the formulas. Comment on your results and explain any potential abnormal behavior (there should be two).

Summary

This question belongs to MATLAB software and discusses about application of MATLAB in mathematics to solve trigonometric functions using the first order accurate forward difference, second-order accurate central difference, and fourth-order accurate central difference formulas.

Answer is in MATLAB format

### Comments

• Rasha

this is a very good website

• maani

I have 50 questions for the same test your page is showing only 28

• joeanne

hi can you please help or guide me to answer my assignments. thanks

• joeanne

hi can anyone help or guide me to my assignments. thanks

• Monik

• Cristina

This solution is perfect ...thanks

• Janete

Hello Allison,I love the 2nd image that you did! I also, had never heard of SumoPaint, is something that I will have to exolpre a bit! I understand completely the 52 (or so) youtube videos that you probably watched. Sometimes they have what you want, sometimes they don't! However, it is always satisfying when you are able to produce something that you have taught yourself. Great job!Debra 0 likes

• Sandeep

Perfect bank of solution.

• Oxana

great !

• Paul Brandon-Fritzius

thanks for the quick response. the solution looks good. :)

• tina Johnson

thnx for the answer. it was perfect. just the way i wanted it.

• Giuseppe

works fine.