% Tartaglia's Problem
%%   divide 8 into two parts to max ....   x1*x2*(x1-x2)
clear all
clf
[X,Y] = meshgrid(0:.1:8, 0:.1:8);
Z = X .* (Y.*(X-Y));
surf(X,Y,Z)
pause
surfl(X,Y,Z)
pause
x=4:.1:8;
plot(x,x.*(8-x).*(2*x-8) )
xs1=4+4/sqrt(3);
disp(['x_1 is   ',num2str(xs1)])
hold on
plot(xs1,xs1*(8-xs1)*(2*xs1-8) ,'mx')
hold off
