I'm trying to shade the region bounded by y=x^2, y=exp(-x), and the y-axis (in the first quadrant). This is the code I have so far:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\thispagestyle{empty}
\begin{tikzpicture}
\draw[very thin,color=gray,step=.5cm,dashed] (-0.5,-.5) grid (3,4);
\draw[->] (-1,0) -- (3.5,0) node[below right] {$x$};
\draw[->] (0,-1) -- (0,4.5) node[left] {$y$};
\draw [->,samples=100,domain=0:2] plot(\x,{(\x)^2});
\draw [->,samples=100,domain=-0.5:2] plot(\x,{exp(-1*(\x))});
\draw [fill=gray,fill opacity=0.2] {[smooth,samples=100,domain=0:0.70346] plot(\x,{exp(-1*(\x))}) } -- {[smooth,samples=100,domain=0.70346:0] plot(\x,{(\x)^2})};
\end{tikzpicture}
\end{document}
I'm getting a strange line going from the point of intersection to the origin, also an error about not being able to parse this coordinate. What am I doing wrong?


Package tikz Error: Cannot parse this coordinate.Please correct. – Peter Grill Feb 29 '12 at 02:53