# Drawing 3D regions (regions of integration)

Is there any straightforward/easy way of drawing regions of integration or should I not bother with LaTeX and simply create the image from another program?

Sample:

(bounded by x=0, y=0, z=0 and x+y+z=1)

(bounded by z=0, z=2, x=0, y=2 and y=x^2)

(bounded by z=0, x+y=1, x=0, z=sqrt(y))

• Hint: pst-solides3d Commented Dec 18, 2017 at 7:52
• Please try to do something by yourself and then add a minimal working example (MWE) to your post. As is, your question is a just-do-it-for-me one. Commented Dec 18, 2017 at 10:49

You can use 3d-coordinates in tikz. It is not a 3d model, just three vectors in a 2d picture, but it can be quite handy.

\documentclass[11pt]{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[x=(-150:1cm),y=(-30:1cm),z=(90:1cm)]
\draw[->] (0,0,0) -- (1.5,0,0) node[anchor=30]{$x$};
\draw[->] (0,0,0) -- (0,1.5,0) node[anchor=150]{$y$};
\draw[->] (0,0,0) -- (0,0,1.5) node[anchor=-90]{$z$};
%%
\draw[red,fill=gray!30](0,0,0) -- (1,0,0)-- (0,0,1) -- cycle;
\draw[red,fill=gray!30](0,0,0) -- (0,1,0)-- (0,0,1) -- cycle;
\draw[red,fill=gray!30](0,0,0) -- (1,0,0)-- (0,1,0) -- cycle;
\draw[red,fill=gray!30,opacity=0.5](1,0,0) -- (0,1,0)-- (0,0,1) -- cycle;
\end{tikzpicture}
\begin{tikzpicture}[x=(-150:1cm),y=(-30:1cm),z=(90:1cm)]
\draw[->] (0,0,0) -- (1.5,0,0) node[anchor=30]{$x$};
\draw[->] (0,0,0) -- (0,1.5,0) node[anchor=150]{$y$};
\draw[->] (0,0,0) -- (0,0,1.5) node[anchor=-90]{$z$};
%%
\draw[red,fill=gray!30,opacity=0.5](0,0,0) plot[domain=0:1,samples=10,smooth] (\x,\x*\x,0) -- (0,1,0) -- cycle;
\draw[red,fill=gray!30,opacity=0.5](0,0,0) plot[domain=0:1,samples=10,smooth] (\x,\x*\x,0) -- (1,1,0.3) plot[domain=1:0,samples=10,smooth] (\x,\x*\x,0.3) -- (0,0,0);
\draw[red,fill=gray!30,opacity=0.5] (1,1,0) -- (0,1,0) -- (0,1,0.3) -- (1,1,0.3) -- cycle;
\draw[red,fill=gray!30,opacity=0.5] (0,0,0) -- (0,1,0) -- (0,1,0.3) -- (0,0,0.3) -- cycle;
\draw[red,fill=gray!30,opacity=0.5](0,0,0.3) plot[domain=0:1,samples=10,smooth] (\x,\x*\x,0.3) -- (0,1,0.3) -- cycle;
\end{tikzpicture}
\begin{tikzpicture}[x=(-150:1cm),y=(-30:1cm),z=(90:1cm)]
\draw[->] (0,0,0) -- (1.5,0,0) node[anchor=30]{$x$};
\draw[->] (0,0,0) -- (0,1.5,0) node[anchor=150]{$y$};
\draw[->] (0,0,0) -- (0,0,1.5) node[anchor=-90]{$z$};
%%
\newcommand\start{0.03}
\draw[red,fill=gray!30,opacity=0.5] (0,0,0) -- (1,0,0) -- (0,1,0) -- cycle;
\draw[red,fill=gray!30,opacity=0.5] (0,0,0) plot[domain=0:1,samples=100,variable=\y,smooth] (0,\y,{0.5*sqrt(\y)}) -- (0,1,0) -- cycle;
\draw[red,fill=gray!30,opacity=0.5] (1,0,0) plot[domain=0:1,samples=100,smooth] (1-\x,\x,{0.5*sqrt(\x)}) -- (0,1,0) -- cycle;
\fill[fill=gray!30,opacity=0.5] (1-\start,\start,{0.5*sqrt(\start)}) plot[domain=\start:1,samples=100,smooth] (1-\x,\x,{0.5*sqrt(\x)})  plot[domain=1:\start,samples=100,variable=\y,smooth] (0,\y,{0.5*sqrt(\y)}) -- (1-\start,\start,{0.5*sqrt(\start)});
\draw[red] (1,0,0) plot[domain=0:1,samples=100,smooth] (1-\x,\x,{0.5*sqrt(\x)})  plot[domain=1:\start,samples=100,variable=\y,smooth] (0,\y,{0.5*sqrt(\y)});
\end{tikzpicture}
\end{document}


It is rather straightforward to do this with asymptote. Here is an example.

 \documentclass{standalone}
\usepackage[inline]{asymptote}
\begin{document}
\thispagestyle{empty}
\begin{asy}
import three;

size(200);

currentprojection=perspective(4,5,5);

// axes
real r=1.5;
draw(Label("$x$",1), O--r*X, Arrow3(HookHead3));
draw(Label("$y$",1), O--r*Y, Arrow3(HookHead3));
draw(Label("$z$",1), O--r*Z, Arrow3(HookHead3));

draw(X--Y--Z--X--O--Y--O--Z,red);
\end{asy}
\end{document}