MatLab Assignment 8 -- Turn in on November 7



We know that tan-1 = x - x3/3 + x5/5 - ... (-1)k+1 x2k-1/(2k-1) ..., |x| <= 1.
  1. Create a MatLab function which computes the partial sum SN = x - x3/3 + x5/5 - ... (-1)N+1 x2N-1/(2N-1), for a given positive integer N and a real number x in [-1,1].
  2. Test your function with N=16 and x=1/sqrt(3). The answer is: 0.52359877528900. (Use format long to see more digits.) If you multiple this number by 6, you get an approximation of pi.
  3. Approximate pi by each of the following identities with eight decimal digits accuracy. For each case, determine first N using the convergence result for alternating series; and report the approximation, the integer N, and the true error (>> abs(pi-SN)).