Drawing the volume of revolution of a region bounded by two curves











up vote
3
down vote

favorite












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.










share|improve this question







New contributor




SRSR333 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
























    up vote
    3
    down vote

    favorite












    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.










    share|improve this question







    New contributor




    SRSR333 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.






















      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      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.










      share|improve this question







      New contributor




      SRSR333 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      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.







      tikz-pgf asymptote






      share|improve this question







      New contributor




      SRSR333 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      SRSR333 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      SRSR333 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked yesterday









      SRSR333

      162




      162




      New contributor




      SRSR333 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      SRSR333 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      SRSR333 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          3
          down vote













          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.






          share|improve this answer





















          • 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
            14 hours ago


















          up vote
          2
          down vote













          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.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "85"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });






            SRSR333 is a new contributor. Be nice, and check out our Code of Conduct.










             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459599%2fdrawing-the-volume-of-revolution-of-a-region-bounded-by-two-curves%23new-answer', 'question_page');
            }
            );

            Post as a guest
































            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote













            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.






            share|improve this answer





















            • 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
              14 hours ago















            up vote
            3
            down vote













            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.






            share|improve this answer





















            • 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
              14 hours ago













            up vote
            3
            down vote










            up vote
            3
            down vote









            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.






            share|improve this answer












            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.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered yesterday









            DJP

            6,83421629




            6,83421629












            • 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
              14 hours ago


















            • 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
              14 hours ago
















            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
            14 hours ago




            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
            14 hours ago










            up vote
            2
            down vote













            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.






            share|improve this answer



























              up vote
              2
              down vote













              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.






              share|improve this answer

























                up vote
                2
                down vote










                up vote
                2
                down vote









                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.






                share|improve this answer














                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.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited yesterday

























                answered yesterday









                marmot

                74.5k482157




                74.5k482157






















                    SRSR333 is a new contributor. Be nice, and check out our Code of Conduct.










                     

                    draft saved


                    draft discarded


















                    SRSR333 is a new contributor. Be nice, and check out our Code of Conduct.













                    SRSR333 is a new contributor. Be nice, and check out our Code of Conduct.












                    SRSR333 is a new contributor. Be nice, and check out our Code of Conduct.















                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f459599%2fdrawing-the-volume-of-revolution-of-a-region-bounded-by-two-curves%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest




















































































                    Popular posts from this blog

                    How to change which sound is reproduced for terminal bell?

                    Can I use Tabulator js library in my java Spring + Thymeleaf project?

                    Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents