Help developing a differential equation So I'm just studying for my final, and doing some practice DE questions.
I have one that asks me to determine a DE given that we have \$100,000 principle being compounded continuously at 5%, but also being withdrawn at a rate of \$4000 per year.
I start with the standard cont. compound interest equation:
$$
A = Pe^{rt}
$$
But this is involving rates so I take the derivative of the above, and subtract the other rate.
$$
\frac{dA}{dt} = 5000e^{0.05t} - 4000
$$
From here I could integrate to find an eqn. for the amount in terms of t.
Am I on the right track here? I have a feeling I'm way off base here. 
 A: We have:


*

*$M(t)$ is the amount of money in the account at time $t$.

*The rate interest earned is proportional to the balance and constant $0.05$. 

*The rate of withdrawals is constant at $4000$ per year.

*In words, rate of change =  rate of earning interest - rate of withdrawals.


As a DE, this becomes:
$$\dfrac{dM}{dt} = 0.05 M - 4000$$
This leads to the solution:
$$M(t) = c_1 e^{0.05 t} + 80000$$
You were given $M(0) = 100000$, so can find $c_1 = 20000$.
A: It helps to take the time to define everything, including units
t = time in years from now.
A(t) = dollars in bank at time t; A(0)=100,000.
Instantaneous withdrawal rate = \$4000/year
Continuously compounded interest rate = 5%/year
Instantaneous rates are additive and can be considered separately. Make sure the units all match, though. If you receive interest on the bank balance, continuously compounded at an annual rate of 5%, then the loan bank account balance is instantaneously increasing at a rate of 5% of the total amount:
$$
   \frac{dA}{dt} = 0.05 A
$$
If you're also pulling money out at a constant instantaneous rate of \$4000 per year, then the final initial value equation is
$$
   \frac{dA}{dt} = 0.05A - 4,000,\;\;\; A(0)=100,000.
$$
To solve the equation,
$$
       \int_{100,000}^{A(t)}\frac{dA}{A-80,000} = \int_{0}^{t} 0.05 dt
$$
$$
         \ln |A(t)-80,000|-\ln|100,000-80,000| = 0.05t
$$
Moving $\ln(20,000)$ to the right side and exponentiating both sides gives
$$
               A(t) = 80,000+20,000e^{0.05t}.
$$
Here's a question for you: What should you replace $4,000$ with in order to make the account balance (a) decrease with time (b) stay constant with time? HINT: $\frac{dA}{dt}$ is identically $0$ if it is ever $0$; so, if $\frac{dA}{dt} \ne 0$, then it cannot change sign.
