diff(`*`(`^`(x, 2)), x); 1 

`+`(`*`(2, `*`(x))) (1)
 

`:=`(eq1, M = `+`(`*`(Pi, `*`(`^`(r, 2))), `*`(2, `*`(Pi, `*`(r, `*`(h)))))); 1 

M = `+`(`*`(Pi, `*`(`^`(r, 2))), `*`(2, `*`(Pi, `*`(r, `*`(h))))) (2)
 

`:=`(eq2, V = `*`(Pi, `*`(`^`(r, 2), `*`(h)))); 1 

V = `*`(Pi, `*`(`^`(r, 2), `*`(h))) (3)
 

`:=`(tmp1, solve(eq1, h)); 1 

`+`(`/`(`*`(`/`(1, 2), `*`(`+`(M, `-`(`*`(Pi, `*`(`^`(r, 2))))))), `*`(Pi, `*`(r)))) (4)
 

`:=`(tmp2, subs(h = tmp1, eq2)); 1 

V = `+`(`*`(`/`(1, 2), `*`(r, `*`(`+`(M, `-`(`*`(Pi, `*`(`^`(r, 2))))))))) (5)
 

`:=`(dVdr, diff(rhs(tmp2), r)); 1 

`+`(`*`(`/`(1, 2), `*`(M)), `-`(`*`(`/`(3, 2), `*`(Pi, `*`(`^`(r, 2)))))) (6)
 

`:=`(tmp3, solve(dVdr = 0, r)) 

`+`(`-`(`/`(`*`(`/`(1, 3), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`*`(Pi, `*`(M)), `/`(1, 2))))), `*`(Pi)))), `+`(`/`(`*`(`/`(1, 3), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`*`(Pi, `*`(M)), `/`(1, 2))))), `*`(Pi))) (7)
 

`:=`(rmax, tmp3[2]); 1 

`+`(`/`(`*`(`/`(1, 3), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`*`(Pi, `*`(M)), `/`(1, 2))))), `*`(Pi))) (8)
 

`:=`(hmax, subs(r = rmax, tmp1)); 1 

`+`(`/`(`*`(`/`(1, 3), `*`(M, `*`(`^`(3, `/`(1, 2))))), `*`(`^`(`*`(Pi, `*`(M)), `/`(1, 2))))) (9)
 

`:=`(dmax, `+`(`*`(2, `*`(rmax)))); 1 

`+`(`/`(`*`(`/`(2, 3), `*`(`^`(3, `/`(1, 2)), `*`(`^`(`*`(Pi, `*`(M)), `/`(1, 2))))), `*`(Pi))) (10)
 

`:=`(ratio, `/`(`*`(hmax), `*`(dmax))); 1 

`/`(1, 2) (11)
 

tmp2; 1 

V = `+`(`*`(`/`(1, 2), `*`(r, `*`(`+`(M, `-`(`*`(Pi, `*`(`^`(r, 2))))))))) (12)
 

`:=`(f, unapply(subs(M = 10, rhs(tmp2)), r)); 1 

proc (r) options operator, arrow; `+`(`*`(`/`(1, 2), `*`(r, `*`(`+`(10, `-`(`*`(Pi, `*`(`^`(r, 2))))))))) end proc (13)
 

>
 

plot(f(r), r = 0 .. 4); 1 

Plot_2d
 

evalf(subs(M = 10, rmax)); 1 

1.030064539 (14)
 



 

restart; 1 

`:=`(eq1, `+`(`*`(`^`(x(t), 2)), `^`(80, 2)) = `*`(`^`(l(t), 2))); 1 

`+`(`*`(`^`(x(t), 2)), 6400) = `*`(`^`(l(t), 2)) (15)
 

`:=`(eq2, diff(eq1, t)); 1 

`+`(`*`(2, `*`(x(t), `*`(diff(x(t), t))))) = `+`(`*`(2, `*`(l(t), `*`(diff(l(t), t))))) (16)
 

`:=`(eq3, diff(x(t), t) = 20); 1 

diff(x(t), t) = 20 (17)
 

`:=`(eq4, l(t) = 100); 1 

l(t) = 100 (18)
 

`:=`(vbls, [diff(x(t), t) = dX, diff(l(t), t) = dL, x(t) = X, l(t) = L]); 1 

[diff(x(t), t) = dX, diff(l(t), t) = dL, x(t) = X, l(t) = L] (19)
 

`:=`(eq1s, subs(vbls, eq1)); 1; `:=`(eq2s, subs(vbls, eq2)); 1; `:=`(eq3s, subs(vbls, eq3)); 1; `:=`(eq4s, subs(vbls, eq4)); 1 

 

 

 

`+`(`*`(`^`(X, 2)), 6400) = `*`(`^`(L, 2))
`+`(`*`(2, `*`(X, `*`(dX)))) = `+`(`*`(2, `*`(L, `*`(dL))))
dX = 20
L = 100 (20)
 

solve({eq1s, eq2s, eq3s, eq4s}, {L, X, dL, dX}); 1 

{L = 100, X = 60, dL = 12, dX = 20}, {L = 100, X = -60, dL = -12, dX = 20} (21)
 

restart; 1 

 

 

 

`:=`(f, proc (x) options operator, arrow; `+`(`*`(`^`(x, 2)), x, `-`(1)) end proc); 1 

proc (x) options operator, arrow; `+`(`*`(`^`(x, 2)), x, `-`(1)) end proc (22)
 

plot(f(x), x = 0 .. 3); 1 

Plot_2d
 

`:=`(g, unapply(`+`(x, `-`(`/`(`*`(f(x)), `*`(diff(f(x), x))))), x)); 1 

proc (x) options operator, arrow; `+`(x, `-`(`/`(`*`(`+`(`*`(`^`(x, 2)), x, `-`(1))), `*`(`+`(`*`(2, `*`(x)), 1))))) end proc (23)
 

`:=`(x0, .5); 1 

.5 (24)
 

`:=`(x1, g(x0)); 1 

.6250000000 (25)
 

`:=`(x2, g(x1)); 1 

.6180555556 (26)
 

`:=`(x3, g(x2)); 1 

.6180339891 (27)
 

`:=`(x4, g(x3)); 1 

.6180339887 (28)
 

`:=`(x5, g(x4)); 1 

.6180339887 (29)
 

f(x); 1 

`+`(`*`(`^`(x, 2)), x, `-`(1)) (30)
 

f(x5); 1 

-0.1e-9 (31)