I'm a little bit confused by a question I came across. It says: If there were no emigration the population $x$ of a county would increase at a rate of $2.5 \%$ per annum.
By emigration a county loses a population at a constant rate of $n$ people.
When $t$ is in years then $\tfrac{dx}{dt}=\tfrac{x}{40}-n$
$i)$ Find $x$ in terms of $n,P,$ and $t$.
$ii)$ If $n=800,$ $P=30,000, $ and $ x=29734$, then what is $t$?
Here's what I thought you'd do:
$\tfrac{dx}{dt}=\tfrac{x}{40}-n=\tfrac{x}{40}-\tfrac{40n}{40}=\tfrac{x-40n}{40}$
Therefore $\tfrac{40dx}{dt}=x-40n \Rightarrow \tfrac{dx}{x-40n}=\tfrac{dt}{40}$
Integrating both sides we get, for the left hand side :
$\int \tfrac{dx}{x-40n}=\ln(x-40n)+C_1$
Right hand side: $\int \tfrac{dt}{40}=\tfrac{t}{40}+C_2$
Combing these equations we get :
$\ln(x-40n)=\tfrac{t}{40}+C_3$ where $C_3=P$
Exponentiating both sides yields
$x-40n=e^{\tfrac{t}{40}+P}=Pe^{\tfrac{t}{40}}$
Therefore
$x=e^{\tfrac{t}{40}+P}+40n$
But then my problem is noticed when we arrive at part two. Inputting that data into the formula I obtained will result in having to calculate a negative log input to find $t$, but of course those are undefined. Where have I gone wrong?