p[n_, l_, g_, e_]  :=  
      Exp[-n 
          l^2 /(2 e ( 1 -  e) ((1 +  l/2  e)^2))]pt[n_, l_, g_, e_]  :=  
      (1  -  p[n, l, g, e] ) 
        (1  -  p[n, g e (0.5  -  e)  -  l, g, e] )f[n_, g_, e_]  :=  
      FindMinimum[ -pt[n, l, g, e], 
         {l,  g e (0.5  -  e)/8, 0,   g e (0.5  -  e)}]g[n_, g_, e_]  =  
      Plot [ pt[n, l, g, e],  {l, 0, g e (0.5  -  e)}]

g[10, 0.9, 0.3]

D[ pt[n, x, g, e], x]

Simplify[%]

Solve[%  ==  0,  x]

g[40, 0.8, 0.46]

Reduce[ Out[38]  ==  0, x ]

h[n_, g_, e_]  =  
      Plot [1  -   pt[n, l, g, e],  {l, 0, g e (0.5  -  e)}]

h[3, 0.8,  0.4]