# To Shade the Area Between $x^2$ and $\sqrt{x}$

by caffeinemachine   Last Updated June 23, 2018 14:23 PM

I want to draw the following image in tikZ

Basically I want to draw the boundary of the unit square, plot the x^2 and \sqrt x functions, and shade the area between them.

In my attempt to draw the two curves, I tried this

  \usepackage{pgfplots}
\pgfplotsset{compat=1.10}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{patterns}
\pgfplotsset{ticks=none}

\begin{figure}[H]
\centering
\begin{tikzpicture}
\begin{axis}[axis lines=middle,]
\end{axis}
\end{tikzpicture}
\end{figure}


But the output I am getting is

Somehow the \sqrt{x} function is getting flattened out.

Also, how to get rid of the arrows I have in the axes and make an enclosing box like I have in the hand-drawn picture.

Tags :