# restart; # Use newtons method to solve x^2-4=0 with initial guess x0=1 f:=x->x^2-4; phi:=unapply(x-f(x)/D(f)(x),x); x0:=1; x1:=phi(x0); x2:=phi(x1); x3:=phi(x2); x4:=phi(x3); # Find the distance between x4 and the root of x^2-4=0 which # is closest to x4 dist:=2-x4; evalf(dist); # Make change of variables u=1/t in int(1/t) and then v=u^2 with(IntegrationTools); I1:=Int(1/t,t=1..x); I2:=Change(I1,u=1/t); I3:=Change(I2,v=u^2); # Note you can intepret these as log(x)=-log(1/x) and also # as log(x)=-1/2 log (1/x^2) # Find S2, S4, and S8 of Taylor series for exp(1/2) S:=n->Sum((1/2)^k/k!,k=0..n); value(S(2)); value(S(4)); value(S(8)); evalf(S(8)); #