In this we are going to compare the error generated due to different order of approximations.
I used the 1st, 2nd and 4th order of approximation for the above mentioned function.
The computation of the function was done at x=pi/3 and gridspace of dx= pi/20.
From the result we can clearly see that for the same gridspace(dx) the error decreases as we use higher order approximation methods.