[Math] Questions on Differential Equation Interest Problem

calculusordinary differential equations

I have a end-of-chapter group project problem that I am not sure about. I don't know if I am setting it up correctly.

Here is the question:

a) "Money flows continuously into an account at a fixed rate of $k$ dollars per year. If the account is initially set up with a balance of $P$ and if the account earns interest at a fixed annual rate of $r$, how much money is in the account after $t$ years?"

b) "How much of the money in the account after $t$ years is earned in interest?"

c) "An account is opened with an initial investment of 3,000 dollars and 1,200 dollars per year continuously flows into the account. If the account earns continuously compounded interest at an annual rate of 5.2%, how much money is in the account after 5 years?"

I am just not sure if I set it up correctly or how differential equations come into play.

I came up with the balance after $t$ years $B(t)$ is: $B(t)=kPe^{rt}$

Is this correct? Also I would appreciate some direction on how to go about solving part b.

Thanks in advance, the help is much appreciated.

Best Answer

Interesting questions. Can you assume that the interest is also earned continuously (at the given annual rate of $r$)? If so, then a possible starting point might be:

$$\begin{align} \frac{dM}{dt}&=k+rM\\ \int_P^M\frac1{k+rM}dM&=\int_0^t dt\\ \frac1r\ln\frac{k+rM}{k+rP}&=t\\ M(t)&=\left(P+\frac kr\right)e^{rt}-\frac kr\end{align}$$

That was for part (a).

For part (b), the total principal injected from over $t$ years, including the initial sum, is $P+kt$. Hence amount earned in interest is $$\begin{align} M(t)-(P+kt)&=\left(P+\frac kr\right)e^{rt}-\frac kr-(P+kt)\\ &=\left(P+\frac kr\right)(e^{rt}-1)-kt \end{align}$$