\documentclass[tikz,border=8pt]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\definecolor{ink}{HTML}{17324D}
\definecolor{teal}{HTML}{168C80}
\definecolor{gold}{HTML}{D79A2B}
\definecolor{rose}{HTML}{C85B70}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
  at={(0cm,0cm)},anchor=south west,
  width=7.5cm,height=7.0cm,
  title={Rigid-wall square well},
  title style={font=\bfseries,text=ink},
  xmin=-0.18,xmax=1.18,ymin=-0.25,ymax=3.05,
  xlabel={$x/L$},ylabel={energy and shifted $\psi_n$},
  xtick={0,0.5,1},xticklabels={$0$,$1/2$,$1$},ytick={},
  axis line style={ink,semithick},tick style={ink},
  tick label style={font=\small,text=ink},label style={font=\small,text=ink},
  grid=major,grid style={ink!10},samples=181
]
  \addplot[very thick,ink] coordinates {(0,-0.1) (0,3)};
  \addplot[very thick,ink] coordinates {(1,-0.1) (1,3)};
  \addplot[thick,ink] coordinates {(0,0) (1,0)};
  \addplot[dashed,teal!75!black] coordinates {(0,0.65) (1,0.65)};
  \addplot[very thick,teal,domain=0:1] {0.65+0.27*sin(180*x)};
  \addplot[dashed,gold!85!black] coordinates {(0,1.8) (1,1.8)};
  \addplot[very thick,gold,domain=0:1] {1.8+0.27*sin(360*x)};
  \node[anchor=west,font=\small,text=teal!70!black] at (axis cs:1.01,0.65) {$E_1$};
  \node[anchor=west,font=\small,text=gold!75!black] at (axis cs:1.01,1.8) {$E_2$};
  \node[font=\small,text=ink] at (axis cs:0.5,2.65) {$\psi(0)=\psi(L)=0$};
\end{axis}

\begin{axis}[
  at={(8.2cm,0cm)},anchor=south west,
  width=7.5cm,height=7.0cm,
  title={Finite square well},
  title style={font=\bfseries,text=ink},
  xmin=-2.45,xmax=2.45,ymin=-1.45,ymax=0.55,
  xlabel={$x/a$},ylabel={$V/V_0$ and shifted $\psi_e$},
  xtick={-2,-1,0,1,2},ytick={-1,0},yticklabels={$-1$,$0$},
  axis line style={ink,semithick},tick style={ink},
  tick label style={font=\small,text=ink},label style={font=\small,text=ink},
  grid=major,grid style={ink!10},samples=181
]
  \addplot[very thick,ink] coordinates {(-2.45,0) (-1,0) (-1,-1) (1,-1) (1,0) (2.45,0)};
  \addplot[dashed,rose!80!black] coordinates {(-2.45,-0.48) (2.45,-0.48)};
  % k a=0.8 and k tan(k a)=kappa give kappa a approximately 0.824.
  \addplot[very thick,rose,domain=-1:1] {-0.48+0.31*cos(deg(0.8*x))};
  \addplot[very thick,rose,domain=1:2.45] {-0.48+0.31*cos(deg(0.8))*exp(-0.824*(x-1))};
  \addplot[very thick,rose,domain=-2.45:-1] {-0.48+0.31*cos(deg(0.8))*exp(-0.824*(-x-1))};
  \node[anchor=west,font=\small,text=rose!75!black] at (axis cs:1.05,-0.48) {$E<0$};
  \node[font=\small,text=ink,fill=white,inner sep=2pt] at (axis cs:0,-1.25)
    {$k\tan(ka)=\kappa$};
\end{axis}
\end{tikzpicture}
\end{document}
