\( (*\ The\ electron\ \ \((mass = 
            1\ a . u . )\)\ arrives\ from\ the\ left\ with\ the\ kinetic\ energy\ EE\ and\ hits\ the\ system\ of\ two\ potential\ energy\ barriers, \ 
      each\ of\ height\ V\ and\ width\ \ A\ separated\ by\ distance\ \ L . \ 
          We\ calculate\ the\ wave\ function\ \((real\ and\ imaginary\ parts, \ "by segments")\)\ solving\ the\ \ Schroedinger\ \(\(equation\)\(.\)\)*) 
Clear[A, V, EE, L, k1, BETA, k, N2, k2, m, B1, A2, B2, A3, 
      B3, A4, B4, A5, freal1, freal2, freal3, freal4, freal5, fim1, fim2, 
      fim3, fim4, fim5]\)
A = 1;
V = 5. ;
EE = 5.037;
L = 3.14159;
k1 = Sqrt[2*EE];
BETA = ArcSin[EE/V];
k = Exp[A*Cot[BETA]*Sqrt[2*EE]];
N2 = (1 - k^2)^2*(Cos[2*BETA])^2 + (1 + k^2)^2*(Sin[
                  2*BETA])^2;
k2 = Sqrt[2*(EE - V)];

m = {B1, A2, B2, A3, B3, A4, B4, A5} /. 
          Solve[1 + B1 == A2 + B2 && 
              A2*Exp[I*k2*A] + B2*Exp[-I*k2*A] == 
                A3*Exp[I*k1*A] + B3*Exp[-I*k1*A] && 
              A3*Exp[I*k1*(A + L)] + 
                  B3*Exp[-I*k1*(A + L)] == 
                A4*Exp[I*k2*(A + L)] + B4*Exp[-I*k2*(A + L)] && 
              A4*Exp[I*k2*(2*A + L)] + 
                  B4*Exp[-I*k2*(2*A + L)] == 
                A5*Exp[I*k1*(2*A + L)] && 
              k1 - k1*B1 == k2*A2 - k2*B2 && 
              A2*k2*Exp[I*k2*A] - B2*k2*Exp[-I*k2*A] == 
                A3*k1*Exp[I*k1*A] - B3*k1*Exp[-I*k1*A] && 
              A3*k1*Exp[I*k1*(A + L)] - 
                  B3*k1*Exp[-I*k1*(A + L)] == 
                A4*k2*Exp[I*k2*(A + L)] - 
                  B4*k2*Exp[-I*k2*(A + L)] && 
              A4*k2*Exp[I*k2*(2*A + L)] - 
                  B4*k2*Exp[-I*k2*(2*A + L)] == 
                A5*k1*Exp[I*k1*(2*A + L)], {B1, A2, B2, A3, B3, A4, B4, 
              A5}];
{B1, A2, B2, A3, B3, A4, B4, A5} = {m[[1, 1]],  m[[1, 2]], 
        m[[1, 3]],  m[[1, 4]],  m[[1, 5]],  m[[1, 6]],  
        m[[1, 7]],  m[[1, 8]]}

freal1 = 
      Re[Exp[I*k1*x] + B1*Exp[-I*k1*x]]
freal2 = 
      Re[A2*Exp[I*k2*x] + B2*Exp[-I*k2*x]]
freal3 = 
      Re[A3*Exp[I*k1*x] + B3*Exp[-I*k1*x]]
freal4 = 
      Re[A4*Exp[I*k2*x] + B4*Exp[-I*k2*x]]
freal5 = Re[A5*Exp[I*k1*x]]
Plot[freal1, {x, -10, 0}];
Plot[freal2, {x, 0, 1}];
Plot[freal3, {x, 1, 4.14159}];
Plot[freal4, {x, 4.14159, 5.14159}];
Plot[freal5, {x, 5.14159, 10}];

fim1 = Im[Exp[I*k1*x] + B1*Exp[-I*k1*x]]
fim2 = 
      Im[A2*Exp[I*k2*x] + B2*Exp[-I*k2*x]]
fim3 = 
      Im[A3*Exp[I*k1*x] + B3*Exp[-I*k1*x]]
fim4 = 
      Im[A4*Exp[I*k2*x] + B4*Exp[-I*k2*x]]
fim5 = Im[A5*Exp[I*k1*x]]
Plot[fim1, {x, -10, 0}];
Plot[fim2, {x, 0, 1}];
Plot[fim3, {x, 1, 4.14159}];
Plot[fim4, {x, 4.14159, 5.14159}];
Plot[fim5, {x, 5.14159, 10}];