I have the following question :
10 million people in a country, if the country does not accept people from other countries its population decreases by 2 percent a year. The country accepts A people a year. How big must be A in order that the population in the country increases?
What I did
I think that the ODE that solves this is $x'(t)=x(t)*k+A$ since the rate of growth population depend on the current population factor $k$ and constant $A$.
I tried to use the data given, we know that (time given in years) $$0.98*x(t_0) = x(t_0 +1)$$
so we can substitute $x(t_0 +1)$ from equation above we need to find $A$ such that $$x(t_0)*0.98 + A=x(t_0)$$
We know that (general equation) :
$$x(t)=-\frac{a}{k}+Ce^{kt}$$
Therefore in the problem case:
$$-\frac{a}{k}+Ce^{kt_0}*0.98+A=-\frac{a}{k}+Ce^{kt_0}$$
Therefore :
$$ln(0.98)+ln(A)-ln(C)=0$$
Which seems unreasonable, I can't figure out what's wrong with my solution.
Any help will be appreciated, thanks.
Suppose that the population $x$ is decreasing over time $t$ at a rate proportional to the population size:
$$\frac{dx}{dt}=-kx$$
If the initial population size is $x_0$ this leads to the following solution:
$$x=x_0e^{-kt}$$
The population at the end of $T=1$ year will be:
$$x_0(1-p)=x_0e^{-kT}$$
...which leads to:
$$kT=-\ln(1-p)\tag{1}$$
...with $p$ being the percentage of reduction.
Now assume that we have an influx of $A$ immigrants uniformly spread over a period of T (1 year). The differnetial equation that describes change in the population size is:
$$\frac{dx}{dt}=-kx+\frac AT$$
The initial conditions are the same $(t=0 \implies x=x_0)$. You can easily solve this equation and the solution is:
$$x=\frac 1k\left[\frac AT-(\frac AT-kx_0)e^{-kt}\right]\tag{2}$$
Suppose that the annual influx of immigrants is sufficiently big to prevent populaiton decrease. Simply put, we want $x(T)$ to be $x_0$. Putting $t=T,x=x_0$ into (2) gives:
$$kx_0=\frac AT$$
$$A=kx_0T$$
...or, if you take (1) into account:
$$A=-x_0\ln(1-p)\tag{3}$$
In your case: $x_0=1,000,000$ and $p=0.02$. This gives:
$$A\approx20,203$$
...which is more than we expected (20,000). Also note that for the value of $A$ as in (3), $x=x_0=\text{const}$ over time.