7

I am trying to illustrate the disk and shell methods for computing the volume of solids of revolution. I was able to use the following code to create a typical approximating disk when the revolution is about the x-axis. I am stuck on how to create a typical approximating shell when the same region is revolved about the y-axis. How might I achieve this?

\documentclass[12pt]{article}
\usepackage{tikz}
\begin{document}
    \begin{tikzpicture}[scale=1,>=latex,x=1.5cm,y=0.8cm]
        \fill[fill=green,opacity=0.5] (1,0) -- plot[domain=1:4] (\x,{sqrt(2*(\x)+1))}) -- (4,0);
        \fill[fill=green,opacity=0.5] (1,0) -- plot[domain=1:4] (\x,{-sqrt(2*(\x)+1))}) -- (4,0);
        \draw[-,thick,domain=-.2:4.5,samples=100] plot (\x,{sqrt(2*(\x)+1))}) node[right] {\footnotesize $y=f(x)$};
        \draw[-,thick,domain=-.2:4.5,samples=100] plot (\x,{-sqrt(2*(\x)+1))});
        \draw[fill=gray!50] (4,0) circle [x radius =.2 , y radius =3];
        \draw[fill=gray!50] (1,0) circle [x radius =.2 , y radius =1.732050808];
        \draw[fill=red!40] (2.3,0) circle [x radius =.2 , y radius =2.449489743];
        \fill[red!40] (2.3,-2.449489743) rectangle (2.7,2.449489743);
        \draw[fill=red!40] (2.7,0) circle [x radius =.2 , y radius =2.449489743];
        \draw (2.3,2.449489743) -- (2.7,2.449489743);
        \draw (2.3,-2.449489743) -- (2.7,-2.449489743);
        \draw[<->] (2.3,-2.6) -- (2.7,-2.6) node[below, midway] {\footnotesize $\Delta x$};
        \draw[<->] (2.9,0) -- (2.9,2.449489743) node[right, midway]  {\footnotesize $R$};
        \draw[->,thick] (-1,0) -- (5,0) node[above] {\footnotesize $x$};
        \draw[->,thick] (0,-5) -- (0,5) node[below right]{\footnotesize $y$};
        \draw[-] (1,3pt) -- (1,-3pt) node[below] {\footnotesize $a$};
        \draw[-] (4,3pt) -- (4,-3pt) node[below] {\footnotesize $b$};
    \end{tikzpicture}
\end{document}
  • I'm not an expert to understand how it should look like. It would be helpful, if you could add an example picture for Illustration. – Harald Lichtenstein Sep 8 '17 at 8:48
  • 1
    This link shows examples:tutorial.math.lamar.edu/Classes/CalcI/VolumeWithCylinder.aspx – DJJerome Sep 9 '17 at 11:36
  • The pgfplots manual on CTAN shows following example, which may be starting point for 3D graphics: % Preamble: \pgfplotsset{width=7cm,compat=1.15} 1 −0.5 0 0.5 \begin{tikzpicture} \begin{axis}[view={60}{30}] \addplot3 [ surf,shader=flat, samples=20, domain=-1:0,y domain=0:2*pi, z buffer=sort, ] ( {sqrt(1-x^2) * cos(deg(y))}, {sqrt(1-x^2) * sin(deg(y))}, x ); \end{axis} \end{tikzpicture} – Harald Lichtenstein Sep 9 '17 at 16:02
  • @DJJerome So my answer was not what you were looking for? – Cragfelt Dec 17 '17 at 3:03
  • 1
    @Cragfelt see figure 3 in this document: stewartcalculus.com/data/CALCULUS%20Concepts%20and%20Contexts/… – DJJerome Dec 28 '17 at 22:13
5

Practically you need to switch all the coordinates and domains, and make some other minor changes. Also obtaining the function in terms of x algebraically.

This is the output according to your code, where revolution is about the x-axis

enter image description here

and this is output after changes, regarding revolution around y-axis.

enter image description here

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}

\begin{document}
    \begin{tikzpicture}[%
            scale=1,
            >=latex,
            x=0.8cm,
            y=1.5cm,
            ]
    \fill[fill=green, opacity=0.5] (-3,4) -- plot[domain=-3:3](\x,{0.5*(\x*\x-1)}) -- (3,4);
    \fill[fill=white] (-1.732050808,1) -- plot[domain=-1.732050808:1.732050808] (\x,{0.5*(\x*\x-1)}) -- (1.732050808,1); 

    \draw[-,thick, domain=-3.2:3.2, samples=100] plot (\x,{0.5*(\x*\x-1)}) node[right] {\footnotesize $y=f(x)$};
    \draw[fill=gray!50] (0,4) circle [y radius =.2 , x radius =3];
    \draw[fill=gray!50] (0,1) circle [y radius =.2 , x radius =1.732050808];
    \draw[fill=red!60] (0,2.3) circle [y radius =.2 , x radius =2.449489743];
    \fill[red!60] (-2.449489743,2.3) rectangle (2.449489743,2.7);
    \draw[fill=red!40] (0,2.7) circle [y radius =.2 , x radius =2.449489743];
    \draw (2.449489743,2.3) -- (2.449489743,2.7);
    \draw (-2.449489743,2.3) -- (-2.449489743,2.7);
    \draw[<->] (-2.6,2.3) -- (-2.6,2.7) node[left, midway] {\footnotesize $\Delta x$};
    \draw[<->] (0,2.9) -- (2.449489743,2.9) node[above, midway]  {\footnotesize $R$};
    \draw[->, thick] (-5,0) -- (5,0) node[above] {\footnotesize $x$};
    \draw[->, thick] (0,-1) -- (0,5) node[below right]{\footnotesize $y$};
    \draw[-] (-3pt,1) -- (3pt,1) node[right] {\footnotesize $a$};
    \draw[-] (-3pt,4) -- (3pt,4) node[right] {\footnotesize $b$};
    \end{tikzpicture}
\end{document}

UPDATE

According to your feedback in comments, I could figured out how to replicate a shell as the document provided, and made respective changes to the original drawing. Maybe now it meets your specs.

enter image description here This is the code

\documentclass[border=4mm,tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}

\begin{document}
\footnotesize

    \begin{tikzpicture}[%
            scale=1,
            >=stealth,
            x=0.8cm,
            y=1.5cm,
            ]
    \tikzset{cyl/.style = {thick,color=red!60}}
    \tikzset{ellip/.style = {gray!80, shading=axis, top color=gray!80, right color=gray!20, thick}}

    %\fill[fill=green, opacity=0.4] (-3,4) -- plot[domain=-3:3](\x,{0.5*(\x*\x-1)}) -- (3,4);
    %\fill[fill=white] (-1.732050808,1) -- plot[domain=-1.732050808:1.732050808] (\x,{0.5*(\x*\x-1)}) -- (1.732050808,1); 

    % Parabola
    \draw[-, blue, thick, domain=-3.2:3.2, samples=100] plot (\x,{0.5*(\x*\x-1)}) node[right] {$y=f(x)$};

    % Ellipses & Cyllinder
    \shadedraw[ellip] (0,4) circle [y radius =.2, x radius =3];
    \shadedraw[ellip] (0,1) circle [y radius =.2, x radius =1.732050808];
    \shadedraw[cyl, shading=axis, top color=red!50, right color=red!15] (0,2.3) circle [y radius =.2, x radius =2.449489743];
    \shadedraw[cyl, draw=none, shading=axis, top color=red!50, right color=red!15] (-2.449489743,2.3) rectangle (2.449489743,2.7);
    \draw[cyl, fill=red!30] (0,2.7) circle [y radius =.2, x radius =2.449489743];
    \shadedraw[cyl, shading=axis, top color=red!15, right color=red!50] (0,2.7) circle [y radius =.16, x radius =2.25];
    \draw[cyl, opacity=0.7, dashed] (0,2.3) circle [y radius =.16, x radius =2.25];
    \draw[cyl, opacity=0.7, dashed] (0,2.3) circle [y radius =.2, x radius =2.449489743];
    \draw[dashed] (2.449489743,0) -- (2.449489743,2.7);
    \draw[dashed] (2.25,0) -- (2.25,2.7);
    \draw[cyl, opacity=0.7, dashed] (-2.25,2.3) -- (-2.25,2.7);
    \draw[cyl] (2.449489743,2.3) -- (2.449489743,2.7);
    \draw[cyl] (-2.449489743,2.3) -- (-2.449489743,2.7);

    % Dimensions
    \draw (-3pt,1) -- (3pt,1) node[right] {$a$};
    \draw (-3pt,4) -- (3pt,4) node[right] {$b$};
    \draw (-57.5pt,2.95) -- node[anchor=south] {$\overline{x}_i$} (-49pt,2.95);
    \draw (-2.449489743,2.5) -- (-2.449489743,3);
    \draw (-2.25,2.7) -- (-2.25,3);
    \node at (2.25,0) [below right] {$x_i$};
    \node at (2.449489743,0) [below left] {$x_{i-1}$};
    \draw[<->, >=stealth] (-2.6,2.3) -- (-2.6,2.7) node[left, midway] {$\Delta y$};

    % Axes
    \draw[thick] (0,-1) -- (0,2.1);
    \draw[thick, dashed] (0,2.1) -- (0,2.535);
    \draw[->, thick] (0,2.535) -- (0,5) node[below right] {$y$};
    \draw[->, thick] (-5,0) -- (5,0) node[above] {$x$};

    \end{tikzpicture}
\end{document}

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.