I have received some help on this, but I am trying to figure out a way to draw solids of revolution without 3-D software. I am trying to draw the attached figure. Here is what I have:
Code: Select all
\documentclass{article}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\pgfplotsset{compat=newest}
\usepackage{amssymb}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{plotmarks}
\usetikzlibrary{arrows}
\usetikzlibrary{shapes.misc, positioning}
\usetikzlibrary{arrows,shapes,positioning}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{arrows.meta,bending}
\tikzset{font=\footnotesize}
\begin{document}
\begin{tikzpicture}
\begin{axis}[thick,
scale only axis,
axis lines=middle,
inner axis line style={-Triangle},
ymin=-5,
ymax=5,
xmin=-1,
xmax=3,
]
\addplot[name path=f,thick, red,samples=1000,domain=0:2]{x^2+1};
\addplot[name path=g,thick,blue, samples=1000,domain=0:2]{-x^2-1};
\draw[thick,dashed] (axis cs:2,0) ellipse [x radius=0.8cm,y radius =3.4cm] ;
\draw[thick,dashed] (axis cs:0.7,0) ellipse [x radius=.3cm,y radius=1cm] ;
\end{axis}
\end{tikzpicture}
\end{document}