kill(all);
load(to_poly_solve);
declare(a,scalar);
assume(a>0);
eq1:h=sqrt(a^2-r^2)+a;
eq2:%pi*r^2*h/3;
define(f(r),subst(eq1,eq2));
define(df(r),diff(f(r),r,1));
define(ddf(r),diff(df(r),r,1));
soln:to_poly_solve(df(r)=0,r);
for s in soln do (
if imagpart(first(s)) then (
if ev(ddf(rhs(first(s))))<0 then (
soln_r:s
)
)
)$
print("Volume",f(rhs(first(soln_r))))$
soln is %union([r = 0],[r = -2^(3/2)*a/3],[r = 2^(3/2)*a/3])
I want
[r = 0,r = -2^(3/2)*a/3,r = 2^(3/2)*a/3]
Is there an easier way than
l:makelist();
for s in soln do l:[l,s];
l:flatten(l);
Tom Dean