find the volume of the surface of revolution created by revolving the graph of fx=x2+2x+3 about the x-axis from x=0 to x=4. in matlab

To find the volume of the surface of revolution created by revolving the given curve around the x-axis, we can use the formula:

V = integral(a,b) (pi * f(x)^2) dx,

where a and b are the limits of integration, and f(x) is the given function.

In this case, f(x) = x^2 + 2x + 3, and a=0, b=4, so we have:

main.m
syms x;
V = int(pi*(x^2+2*x+3)^2, x, 0, 4)
43 chars
3 lines

The output will be the symbolic expression for the volume of the surface of revolution.

Since this expression involves pi, we can use the vpa function to get a numerical approximation:

main.m
V_num = vpa(V)
15 chars
2 lines

Alternatively, we can use the integral function to directly evaluate the definite integral:

main.m
f = @(x) pi*(x^2+2*x+3)^2;
V_num = integral(f, 0, 4);
54 chars
3 lines

Now V_num should contain the numerical value of the volume of the surface of revolution.

To visualize the surface of revolution, we can use the fsurf function:

main.m
f = @(x,y) x^2 + 2*x + 3;
fsurf(f, [0 4 0 10])
47 chars
3 lines

This will create a 3D plot of the surface of revolution.

related categories

gistlibby LogSnag