============================================================================== areaShell.m ============================================================================== % % Computes the area of the shell taken by cutting the torus given by % (x - 2)^2 + y^2 = 1 % parallel to the y-axis at x. % function a = areaShell(x) % Area of the shell at x is 2*pi*x*ht(x) % where ht(x) is the height of the shell at x height = 2*sqrt(1 - (x - 2).^2); a = 2*pi*x.*height; ============================================================================== volumeTorus.m ============================================================================== % % Computes the volume of the solid obtained by cutting the torus along % the x-axis at t. % function vol = volumeTorus(t) vol = quad('areaShell', 1, t); ============================================================================== volLess20.m ============================================================================== % % Computes (the volume of the solid obtained by cutting the torus along % the x-axis at t ) - 20 % % It's necessary to do this to use the function with Matlab's fzero % function (which assumes equations are set up in standard form: % f(x) = 0). % function vol = volLess20(t) vol = volumeTorus(t) - 20;