# Ejercicio 9.16

kill(all)$

f1(x):= sqrt(9 - x^2);        f2(x):= - sqrt(9 - x^2);   
g1(x):= sqrt(6*x-x^2);      g2(x):= -sqrt(6*x-x^2);

wxplot2d([f1(x),f2(x), g1(x), g2(x)], [x,-4,7], [y, -4, 4], [legend, ""] , [style, [lines, 2]] ,
[gnuplot_preamble, "set size ratio 1; set grid"], [nticks, 300] )$

Eq1: 9-x^2 = 6*x-x^2;

solve([Eq1] , x);

x1 = x1 : 3/2;

'y1 = y1: f1(x1);

'V1=V1: %pi*(integrate((9 - y^2)^2, y, 0, y1) - integrate (3-sqrt(9-y^2), y, 0, y1));

Volum = 2*V1;