Write a program to calculate the volume under x^2 + 1 curve when the curve is rotated around the x axis. Integration should be x from 0 to 3 with x incrementing by 0.1. How would i write this program?

 Accepted Answer

Star Strider
Star Strider on 6 Mar 2019
See the Wikipedia article on Solid of revolution (link) for inspiration.

2 Comments

I know how to do the calculation i dont know how to do the code for it
You’re rotating about the x-axis, so use the Disk method. This involves squaring the value of the function at each interval, and multiplying it by π.
Try this:
f = @(x) x.^2 + 1;
x = 0 : 0.1 : 3;
y = pi*cumtrapz(f(x).^2);
Experiment to get the result you want.

Sign in to comment.

More Answers (0)

Categories

Find more on Interactions, Camera Views, and Lighting in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!