%Computes the volume of a solid of revolution
%between the two curves around the x axis

%Define symbolic variables and curves
syms x
f1 = 4 - x^2;
f2 = x^2;
%Plot
clf; ezplot(f1); hold on; ezplot(f2);
%solve for bounds
bounds = solve(f1 == f2)
%convert bounds to double floating point 
%and list from small to high
bounds = sort(double(bounds))
%evaluate the integral
vol = int(pi*(f1^2 - f2^2),x,bounds(1), bounds(2));
%display as floating point
vol = double(vol)
%You could have done this by hand as well, and get this answer:
true_vol = 2*pi*(16*sqrt(2) - 8/3*sqrt(2)^3)
%..as you can see, the answers are the same

