\documentclass[border=5pt]{standalone}
\usepackage{tikz, pgfplots}
\pgfplotsset{compat=1.15}

\begin{document}
\begin{tikzpicture}

\begin{axis}[
width=7.5cm,
height=3cm,
at={(0.0cm,3.5cm)},
scale only axis,
xmin=0,
xmax=10,
ymin=-40,
ymax=60,
axis background/.style={fill=white},
xmajorgrids,
ymajorgrids,
legend style={legend cell align=left, align=left, draw=white!15!black}
]
\addplot [color=blue, solid, line width=1pt, mark=o, mark options={solid, blue}]
  table[row sep=crcr]{%
0	-40\\
1	-9.3585028142666\\
2	5.51767264717709\\
3	10.5629937718162\\
4	10.9719102963344\\
5	9.25892363096628\\
6	5.99418388727221\\
7	3.30928824847435\\
8	1.32177595088701\\
9	-0.31813900936373\\
10	-1.39327410751767\\
};
\addlegendentry{$x_1$}

\addplot [color=red, dotted, line width=1pt, mark=o, mark options={solid, red}, forget plot]
  table[row sep=crcr]{%
0	40\\
1	30.0426357376669\\
2	19.8832463980677\\
3	10.3879896106416\\
4	0.764762161600457\\
5	-8.39145679214616\\
6	-10.6235760097651\\
7	-8.97313357609425\\
8	-6.26312204617795\\
9	-3.88253076117011\\
10	-2.4040733744948\\
};

\addplot [color=red, solid, line width=1pt, mark=o, mark options={solid, red}]
  table[row sep=crcr]{%
0	40\\
1	20.7203354740707\\
2	8.19372389284068\\
3	2.25637729003613\\
4	-1.24026929274027\\
5	-3.12942432278591\\
6	-3.07245023961244\\
7	-2.00934174388728\\
8	-1.68212278471176\\
9	-0.795751328609192\\
10	-0.767041628031613\\
};
\addlegendentry{$x_2$}

\addplot [color=blue, dotted, line width=1pt, mark=o, mark options={solid, blue}, forget plot]
  table[row sep=crcr]{%
0	-40\\
1	-4.96894666634425\\
2	20.5555337445424\\
3	35.5571229497868\\
4	41.3369210346659\\
5	37.3450705373759\\
6	27.7108800449181\\
7	17.9726491391822\\
8	10.1890582850044\\
9	5.66159763132641\\
10	2.24596701224095\\
};

\addplot [color=blue, dashed, line width=1pt, mark=o, mark options={solid, blue}, forget plot]
  table[row sep=crcr]{%
0	-40\\
1	-6.55111211004422\\
2	15.3349048804532\\
3	26.423701740268\\
4	27.6064577784954\\
5	22.069307460015\\
6	15.0810012586531\\
7	8.71953394363248\\
8	4.24482587905148\\
9	1.93960093074201\\
10	0.276478708164053\\
};
\addplot [color=red, dashed, line width=1pt, mark=o, mark options={solid, red}, forget plot]
  table[row sep=crcr]{%
0	40\\
1	27.6363812407324\\
2	16.3144135829931\\
3	6.24784837752746\\
4	-3.2970349043112\\
5	-7.24388654598225\\
6	-7.36621576295183\\
7	-5.69299053890974\\
8	-3.28084749903115\\
9	-1.79103315183045\\
10	-1.17617601786355\\
};

\end{axis}

\begin{axis}[
width=7.5cm,
height=3cm,
at={(0cm,0cm)},
scale only axis,
xmin=0,
xmax=9,
ymin=-20.0477129823669,
ymax=2.34512869770875,
axis background/.style={fill=white},
xmajorgrids,
ymajorgrids,
legend pos=south east,
legend style={legend cell align=left, align=left, draw=white!15!black}
]
\addplot [color=blue, solid, line width=1pt, mark=o, mark options={solid, blue}]
  table[row sep=crcr]{%
0	-20.0477129823669\\
1	-12.0641159282694\\
2	-6.67753483301098\\
3	-3.70954449379207\\
4	-1.43156649763836\\
5	0.199168145187533\\
6	0.836018053926002\\
7	0.673098070317212\\
8	0.863134353556482\\
9	0.60346714238145\\
};
\addlegendentry{$u$}

\addplot [color=blue, dotted, line width=1pt, mark=o, mark options={solid, blue}, forget plot]
  table[row sep=crcr]{%
0	-9.99999999954731\\
1	-9.99999999374598\\
2	-9.9999999512041\\
3	-9.99999999723729\\
4	-9.55467025162155\\
5	-2.0552030366398\\
6	1.44588850619437\\
7	2.34512869770875\\
8	2.12411845938333\\
9	1.45216139940581\\
};
\addplot [color=blue, dashed, line width=1pt, mark=o, mark options={solid, blue}, forget plot]
  table[row sep=crcr]{%
0	-12.2131900051978\\
1	-11.3153332070849\\
2	-10.3756259291654\\
3	-9.68744986840332\\
4	-3.48283826577566\\
5	0.329276741786579\\
6	1.85757971922099\\
7	2.04289618158387\\
8	1.33869984507013\\
9	0.808923165069144\\
};
\end{axis}
\end{tikzpicture}
\end{document}