To find the volume of the surface of revolution created by revolving the region bounded by the equations y=2*tan(x) and y=sec(x)-1 between x=0 and x= 4 about the x-axis in MATLAB, we need to use the formula of surface area of revolution and integrate it.
The formula for the surface area of revolution is given by:
S = 2*pi*int(b-a)[f(x)*sqrt(1+(dy/dx)^2)]dx
In our case, the equation for the surface is given by y=f(x)
. So, we need to calculate S
by integrating this equation with respect to x.
Here's the MATLAB code to find the volume:
main.m341 chars17 lines
This code first defines the functions f(x) and g(x), and the limits of integration a=0 and b=4. Then, it calculates the surface area S
using the formula and integrates it to find the volume V
. Finally, it displays the volume.
Note that the syms
command is used to define x
as a symbolic variable, so that MATLAB can perform symbolic integration.
The output of this code will be the value of the volume of the surface of revolution.
gistlibby LogSnag