# Survival function of particles with different starting points

I am studying diffusion equations to model the diffusion of fluorescence particles into a cell monolayer. The easiest way is to model them starting from a point source (x = 0 at t = 0 -> $$x_\mathrm{0}$$), that can diffuse freely (for example with the diffusivity factor D = 0.25). At x = 5 the particles are absorbed. I have found the following formula describing the survival function (the number of particles that have not been absorbed):

$$S(t) = erf(\frac{x_f}{\sqrt{4Dt}})$$

erf is the error function; $$x_\mathrm{f}$$ is the location of the absorbing boundary (therefore x = 5). I am able to match my simulations (monte-carlo approach) with this function. However, if i simulate particles to be released at $$x_\mathrm{0}$$ = 0 or $$x_\mathrm{0}$$ = -1 or $$x_\mathrm{0}$$ = -2, the above function obviously fails. I can however match the function with an average of the survival functions with $$x_\mathrm{f}$$ = 5, $$x_\mathrm{f}$$ = 6 and $$x_\mathrm{f}$$ = 6:

$$S(t) = \frac{\sum_{i=5}^{6}erf(\frac{i}{\sqrt{4Dt}})}{3}$$

In the end, I would like to find a way to convert the function S(t) that it depends on the minimum and maximum of the starting positions. Can someone point me in the right direction (maybe a related mathematical technique), as math and physics are not my major fields (more a field of enthusiasm)? Thank you

$$S(t) = \frac{\int_a^b{erf(\frac{x_f}{\sqrt{4Dt}})dx_f}}{b-a}$$
which gives: $$S(t) = \left[\frac{\sqrt{4Dt}*exp(-\frac{b^2}{4Dt})}{\sqrt\pi} - \frac{\sqrt{4Dt}*exp(-\frac{a^2}{4Dt})}{\sqrt\pi} - a*erf(\frac{a}{\sqrt{4Dt}}) + b*erf(\frac{b}{\sqrt{4Dt}})\right] * \frac{1}{b-a}$$