Plotting functions witz Tikz - where does this hole come from?

The answer to the question why there is a gap is

because LaTeX is not a computer algebra system.

So we have to help TikZ to do the right thing. In any case, if we want a smooth, continuous curve, we might want to draw each component in one stroke. This can be achieved by choosing a different parametrization such as

\documentclass{article}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
\draw[blue!50!black] plot[domain=-2:2,smooth,thick,samples=101]
 ({(1/sqrt(2))+abs(\x)},{sign(\x)*sqrt(2*\x*\x+2*sqrt(2)*abs(\x))});
\draw[blue!50!black] plot[domain=-2:2,smooth,thick,samples=101]
 ({-(1/sqrt(2))-abs(\x)},{sign(\x)*sqrt(2*\x*\x+2*sqrt(2)*abs(\x))});
\end{tikzpicture}
\end{document}

enter image description here

A perhaps even simpler reparametrization is

\documentclass{article}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
\draw[blue!50!black] plot[domain=-4:4,smooth,thick,samples=101]
 ({sqrt(1/2+\x*\x/2)},\x);
\draw[blue!50!black] plot[domain=-4:4,smooth,thick,samples=101]
 ({-sqrt(1/2+\x*\x/2)},\x);
\end{tikzpicture}
\end{document}

Tags:

Tikz Pgf