3

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.

3

Welcome to TeX.SE! If you compile

\documentclass{standalone}
\usepackage{asypictureB}
\begin{document}
\begin{asypicture}{name=hyperboloid}
// from http://asymptote.sourceforge.net/gallery/hyperboloid.asy
settings.outformat="pdf";
settings.prc = false;
size(200);
import solids;

currentprojection=perspective(4,4,3);
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);
draw(surface(quadratic),green,render(compression=Low,merge=true));
draw(surface(cubic),blue,render(compression=Low,merge=true));
draw(surface(linear),red,render(compression=Low,merge=true));
\end{asypicture}
\end{document}

with

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.

3

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.

\documentclass{article}
\usepackage{sagetex}
\begin{document}
This is volume of revolution when area bounded by $f(x)=x^2$ and $g(x)=x^3$
is rotated around the $x$-axis:
\begin{sagesilent}
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
\end{sagesilent}
\begin{center}
\sageplot[width=3.5in]{Mypic}
\end{center}
\end{document}

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.