Explorations of d'Alembert's Series
The command SquareRoot[x,n] computes the first n terms of the binomial series expansion of a and compares it to the actual value (10-digit accuracy).
| > | SquareRoot := (x,n) -> [1+evalf(sum((-1)^(k-1)*(2*k-2)!/2^(2*k-1)/k!/(k-1)!*x^k,k=1..n),10),evalf(sqrt(1+x),10)]; |
| > | SquareRoot(200/199,100); |
The next command computes this function at ten values of n: m/10, 2m/10, ..., m. If we chooose a value of m that is not a multiple of 10, it computes these at the floors. This is useful so that the number of terms is not always even or always odd.
| > | SquareRootList := (x,m) -> [seq([floor(j*m/10),SquareRoot(x,floor(j*m/10))[1]],j=1..10)]; |
| > | SquareRootList(200/199,1007); |
The last command plots these values.
| > | plots[listplot](SquareRootList(200/199,1007)); |