# pgfplots: How to draw a tangent graph below two others?

Assumed I want to draw three simple graphs based on the following illustration:

How can I plot those three graphs? I've tried to create something like this:

Minimum Working Example (MWE):

\documentclass{standalone}
\usepackage{pgfplots}

\begin{document}
\begin{tikzpicture}
\begin{axis}[domain=0:1]
\end{axis}
\end{tikzpicture}
\end{document}


Screenshot of the current state:

Description of the issue:

However, I don't get the point on how to figure out the function of the third graph as well as how to clip the graphs in x and y direction to align them centered in the plot. It is not necessary to be completely precise, the accuracy of my upper template will be fine enough.

How to do that?

• @close-voter: Please explain in a comment your reason for voting to close! – Mensch Apr 1 at 20:15
• I accept the Kurt's comment. – Sebastiano Apr 1 at 20:39

You can use the function f1*f2/(f1+f2) to get something like what you describe. To make the code a bit clearer I defined the functions f1 and f2.

\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{%
compat=1.12,
/pgf/declare function={f1(\x)=exp(3*\x);},
/pgf/declare function={f2(\x)=-exp(3*\x)+20;},
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[domain=0:1]
\end{axis}
\end{tikzpicture}
\end{document}


If you want the function to follow more closely you can use sqrt(f1^2*f2^2/(f1^2+f2^2). Then replace the third plot with

\addplot+[no marks, samples=100] {sqrt(f1(x)*f1(x)*f2(x)*f2(x)/(f1(x)*f1(x)+f2(x)*f2(x)))};


to get

Slightly more general, one can use the exponent \a (does not have to be an integer):

 \foreach \a in {1,...,5}{
}


• The lower one looks perfect, thank you very much!! – Dave Apr 1 at 21:13
• Your last edit is simply perfect! Thank you so much! – Dave Apr 6 at 18:29

Are you looking for the minimum? (I shifted the plot a bit but you can of course undo the shift.)

\documentclass[border=3.14mm,tikz]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}[domain=0:1]