Scroll to Top

Virtual Math Learning Center

Virtual Math Learning Center Texas A&M University Virtual Math Learning Center

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

Problem: Find the volume of the ellipsoid formed by rotating \(y=\frac{b}{a} \sqrt{a^2-x^2}\) about the \(x\)-axis.

Python Code:
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)

Python Code:
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

See more videos from this section