\(\(\( (*\ 
      kernel\ density\ for\ birth - 
            death\ process\ with\ species\ sampling . \ \ Works\ only\ if\ 
l != 
          u . \ \ Make\ them\ slightly\ different\ if\ l = \(\(u\)\(.\)\)\ *) \)\(
\)\(\(po[t_, l_, u_, 
          f_] := \(f\ \((l - u)\)\)\/\(f\ l + \((l\ \((1 - f)\) - u)\)\ Exp[\(-\((l - u)\)\)\ t]\);\)

    \(p1[t_, l_, u_, 
          f_] := \(po[t, l, u, f]\^2\ Exp[\(-\((l - u)\)\)\ t]\)\/f;\)

    \(ut[t_, l_, u_, f_] := 
        1 - \(po[t, l, u, f]\ Exp[\(-\((l - u)\)\)\ t]\)\/f;\)

    \(pdf[t_, t1_, l_, u_, f_] := \(l\ p1[t, l, u, f]\)\/ut[t1, l, u, f];\)

    \(cdf[t1_, t2_, l_, u_, 
          f_] := \(\((\(-1\) + E\^\(t2\ \((l - u)\)\))\)\ \((l - f\ l + E\^\(t1\ \((l - u)\)\)\ f\ l - u)\)\)\/\(\((\(-1\) + E\^\(t1\ \((l - u)\)\))\)\ \((l - f\ l + E\^\(t2\ \((l - u)\)\)\ f\ l - u)\)\);\)

    \(marginal[n_, i_, t1_, t_, l_, u_, 
          f_] := \(1\/\(\(\((i - 1)\)!\)\ \(\((n - 
                      i)\)!\)\)\) \((\(n!\)\ cdf[t1, t, l, u, f]\^\(i - 1\)\ \((1 - cdf[t1, t, l, u, f])\)\^\(n - i\)\ pdf[t, t1, l, u, f])\);\)

    \(prk[t_, l_, u_, f_, 
          k_] := \((1 - po[t, l, u, f])\)\ \((1 - 
              ut[t, l, u, f])\)\ ut[t, l, u, f]\^\(k - 1\);\)

    \(expectk[t_, l_, u_, 
          f_] := \(\(-l\) + f\ l + u - E\^\(t\ \((l - u)\)\)\ f\ u\)\/\(\(-l\) + u\);\)\)\)\)

lambda = 2. ;  mu = 2.0001;  
    fraction = 0.1;
Plot[pdf[t, 1. , lambda,  mu,  fraction], {t,  .001, 1},  
        PlotRange -> {0, 2},  Frame -> True];

P0t[t_, l_, u_, f_] := 
        f (l - 
                u)/(f*l + (l*(1 - f) - u)*
                  Exp[(u - l) t]);
P0tEqual[t_, u_, f_] := f/(1 + f*u*t);