The two pool system is described by the following differential equations *:

d Q1 / dt = - ( K12 + Ke) Q1 + K21 Q2
d Q2 / dt = - K21 Q2 + K12 Q1

where the Qs are the total amounts in the pools, and dQ/dt is the rate of change of Q with respect to time. For each pool, the outward flow (negative terms) is just the amount of drug in the pool times the sum of all the Ks that represent outward flows. The inward flow is the sum of all products of inward Ks times the amount of drug in each pool associated with the K. The solutions are:

Q1 = a1 exp( -alpha t) + b1 exp( -beta t)
Q2 = a2 exp( -alpha t) + b2 exp( -beta t)

It is useful to define these intermediate constants:

Ksum = K12 + K21 + Ke
K4 = 4 K21 Ke

now we can give alpha and beta as:

alpha = 0.5 (Ksum + sqrt( Ksum2 - K4))
beta = 0.5 (Ksum - sqrt( Ksum2 - K4))

finally we use the dose, D (the value of Q1 at t=0), to obtain the two a's and two b's:

a1 = D (K21 - beta) / (alpha - beta)
b1 = D (beta - K21) / (alpha - beta)
b2 = - a2 = K12 D / (alpha - beta)

* On this page I use:

alpha, beta instead of lambda1, lambda2
exp(x) instead of ex