# Graphing a function that isn't bijective

I want to create the following set of curves. However, 2) is not ill-defined because it's not bijective. How can this graphed on Tikz? I tried drawing, but this doesn't produce smooth looking curves.

1) y=x^0.5-x

2) x=y^0.5-y

• These are called parametric plots and can be made easily. – user121799 Mar 27 '18 at 18:06
• "ill-defined because it's not bijective" should be ""well-defined because it's multivalued" – Benjamin McKay Mar 27 '18 at 19:07

Here an example using pgfplots, but you can do the same with TikZ only.

\documentclass[tikz,border=2mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\begin{document}
\tikzset{declare function={f(\x)=(\x)^(1/2)-\x;}}
\begin{tikzpicture}

\begin{axis}[domain=0:0.5,ytick={0,0.5,1},xtick={0,1,2,3,4},
xmin=0,ymin=0,ymax=0.5,xmax=0.5,mark=none,samples=100]