n1:=4
n2:=2
n3:=1
a:=π
a1:=Plot[0, {x, 0, a},PlotRange-> {0, n1^2 +n1}]
p1:=Plot[Sqrt[2/a]*Sin[n1*x*π/a]+n1^2, {x, 0, a},  PlotRange-> {0, n1^2 +n1}]
p1e:=Plot[n1^2, {x,0, a}]
p2:=Plot[Sqrt[2/a]*Sin[n2*x*π/a]+n2^2, {x, 0, a},  PlotRange-> {0, n2^2 +n2}]
p2e:=Plot[n2^2, {x,0, a}]
p3:=Plot[Sqrt[2/a]*Sin[n3*x*π/a]+n3^2, {x, 0, a},  PlotRange-> {0, n3^2 +n2}, GridLines-> {{π-.01}, {}}]
p3e:=Plot[n3^2, {x,0, a}]
Show[a1, p1, p1e,p2, p2e, p3, p3e]