Volumes of Revolution in Python

Author: David Manuel
This video shows how to find the volume of a solid of revolution in Python. The steps to find the volume are explained: graphing the function, finding the points of intersection, and computing the integral. The integral for the volume is set up using the disk method. 

Transcript 22

Exercises

Python Code:

#Volume of the ellipsoid formed by rotating y=b/a * sqrt(a^2-x^2) about the x-axis from sympy import *
x=symbols('x') a,b=symbols('a b') f=b/a*sqrt(a**2-x**2)
fplot=f.subs({a:3,b:4}) print(fplot)
matplotlib notebook
plot(fplot,(x,-3,3))
c=solve(f,x) print(c)
Volume=integrate(pi*f**2,(x,c[0],c[1])) print('The volume of the ellipsoid is',Volume.simplify())

Open Python Notebook File