I'm quite late to this discussion but I'll give advice anyways because other people might be searching for help on this problem. The equation T=(Fx+FD(1-λ)/λ)ln(DM(1-λ)+λMx) can't possibly be correct. At x = D, T must be equal to 0 and in this equation it would be T(x = 0) = (FD/λ)ln(DM)...