# restart; u:=x^2+3*x^7-sin(x); f:=x->x^2+3*x^7-sin(x); f(0); f(1); subs(x=0,u); subs(x=1,u); dudx:=diff(u,x); D(f); # Example 1 of mixing functions and expressions up. D(u); # Example 2 of doing it wrong. diff(f,x); diff(f(x),x); solve(dudx=0,x); plot(dudx,x=-1..1); fsolve(dudx=0,x=0.5); Digits:=60; fsolve(dudx=0,x=0.5); # Problem 4.5#8 in Ellis and Gullick handout eq1:=(w/2)^2+h^2=r^2; A:=h*w; S1:=solve(eq1,w); S1[1]; A2:=subs(w=S1[1],A); dAdh:=diff(A2,h); dAdh2:=simplify(dAdh); A3:=solve(dAdh2=0,h); # The answer to problem 4.5#8 A3[1]; restart; # Problem 4.5#16 in Ellis and Gulick eq2:=250=l*x*x; C:=2*(2*p)*x^2+4*p*l*x; S2:=solve(eq2,l); C2:=subs(l=S2,C); dCdx:=diff(C2,x); S3:=solve(dCdx=0,x); # Solution to 4.5#16 S3[1]; #