# restart; # Exam 2b # Problem 1(i) phi:=unapply(x-f(x)/D(f)(x),x); f:=x->x+4*cos(x); phi(x); # Problem 1(ii) Digits:=20; x1:=phi(2.0); x2:=phi(x1); x3:=phi(x2); x4:=phi(x3); # Problem 1(iii) x1:=phi(4.0); x2:=phi(x1); x3:=phi(x2); x4:=phi(x3); # Problem 2(iv) plot(f(x),x=1..4); # The solutions converge to different # limits because f(x)=0 has multiple # solutions and the solution closest # to 2 is a different solution than the # solution closest to 4. # Problem 2(i) S:=(n,x)->Sum((-1)^l*x^(2*l+1)/(2*l+1)!,l=0..n); seq(value(S(n,2)),n=1..4); Digits:=12; seq(evalf(S(n,2)),n=1..4); # Problem 2(ii) g:=s->2*s*sqrt(1-s^2); seq(value(g(S(n,1))),n=1..4); seq(evalf(g(S(n,1))),n=1..4); # Problem 2(iii) # This can be done using trigonometry and the # formula # sin(2x)=2sin(x)cos(x) # =2sin(x)sqrt(1-sin(x)^2) T1:=sin(2)-g(sin(1)); simplify(T1); # Problem 2(iv) # Error in sequence from part (i) seq(evalf(S(n,2)-sin(2)),n=1..4); # Error in sequence from part (ii) seq(evalf(g(S(n,1))-sin(2)),n=1..4); # The second sequence converges faster. Looking # at the series for the first sequence we see # there is a factor of 2^(2l+1) in the numerator. # Thus, the terms in the first sequence are, in # general larger than for the second sequence, # in where the factor 1^(2l+1)=1 for every l. # This implies the remainer Rn will tend to zero # more slowly than for the second sequence. # Alternatively, one can estimate Rn directly. # The integral for the remainder in the first # sequence has limits x=0..2 which is larger than # the intergral for the remainder in the second # sequence with has limits x=0..1. # Problem 3(i) f:=x->4*sin(ln(1+x)); plot(f(x),x=1..10); L:=Int(sqrt(1+D(f)(x)^2),x=1..10); evalf(L); # Problem 3(ii) Vx:=Int(Pi*f(x)^2,x=1..10); evalf(Vx); # Problem 3(iii) Vy:=Int(2*Pi*x*f(x),x=1..10); evalf(Vy); # Problem 4(i) # Let x by x be the dimensions of the base. # Let y be the height of the holding tank. S:=x*x+4*x*y; V:=x*x*y; s1:=solve(V=2000,{y}); s2:=subs(s1,S); dS:=diff(s2,x); s2:=solve(dS=0,{x}); s3:=evalf(s2[1]); subs(s3,s1); # Problem 4(ii) # It was assumed that the weight of the tank # was proportional to the total surface area. # Problem 5 # This proof problem was done using only # pencil and paper. # Problem 6 eq1:=D(y)(x)-y(x)=x^2; eq2:=y(1)=3; dsolve({eq1,eq2},y(x)); # The integrating factor is u:=exp(-x); y1:=(1/u)*(C+int(u*x^2,x)); y2:=subs(x=1,y1); s4:=solve(y2=3,{C}); y3:=subs(s4,y1); expand(y3); #