I've been preparing my submission of my calculus assignment, and have been typesetting it in LaTeX, using Overleaf v2.

There are problems involving the volume (and surface areas) of the solid of revolution of functions about their axes, and I really wanted to get some neat-looking vector graphics in my submission, but TikZ, Asymptote and PGF have proven to be extremely daunting.

How would I start drawing the volume of revolution of the region bounded by x^2 and x^3, about the x-axis, for instance? If I understood this, I can extend the idea to the rest of the questions.

I understand that MWEs are useful, but I can't get the barest minimum, let alone get it to work.


Welcome to TeX.SE! If you compile

// from http://asymptote.sourceforge.net/gallery/hyperboloid.asy
settings.prc = false;
import solids;

revolution quadratic=revolution(graph(new triple(real z) {
      return (z,0,z*z);},-1,1,40,operator ..),axis=X);
revolution cubic=revolution(graph(new triple(real z) {
      return (z,0,z*z*z);},-1,1,40,operator ..),axis=X);
revolution linear=revolution(graph(new triple(real z) {
      return (z,0,z);},-1,1,40,operator ..),axis=X);


pdflatex -shell-escape

you'll get

enter image description here

As you can see, for the choice x^2 and x^3 the result is not really spectacular, at least not in the domain I chose. To get a more spectacular result, you may want to adjust the function(s) and/or domain.


Here's a possible solution using the sagetex package. This uses a computer algebra system, Sage, to do the work. Documentation for volumes of revolution is here. The documentation refers to running commands using Sage. To get this into a LaTeX document, some adjustments are required.

This is volume of revolution when area bounded by $f(x)=x^2$ and $g(x)=x^3$
is rotated around the $x$-axis:
u = var("u")
f = u^2
g = u^3
sur1=revolution_plot3d(f,(u,0,1),opacity=0.5,rgbcolor= (1,0.5,0),show_curve=True,parallel_axis='x') #rotate u^2 around the x-axis
sur2 = revolution_plot3d(g, (u,0,1), opacity=0.5, rgbcolor=  (0,1,0),parallel_axis='x') #rotate u^3 around the x-axis
Mypic = sur1+sur2 #combine the 2 graphs

The result, running in Cocalc, is below: enter image description here

Be aware, Sage is not part of the LaTeX distribution so it either has to be installed on your computer or accessed through Cocalc.

  • Thanks for the reply; I ended up leaving some space and drew the diagram by hand, as the deadline was approaching. I'll keep this in mind for the next assignment, though. – SRSR333 Nov 13 '18 at 4:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.