# Paying back problem with ODE. What I've done wrong?

Someone wishes to borrow \$200,000 at an interest rate of 6%. Assume that interest is compounded continuously and that payments are also made continuously. Determine the monthly payment that is required to pay off the loan in 20 years. This is problem. and the following is my approch. let$S(t)$be a function that I have to pay at$t$. and let$S(0)=200,000=br=0.06$,$p=$annual payment,$q=$monthly payment$S'=-$(pay off)$+($interest$)$thus $$S'=-p+rS....(*)$$ $$S'=-q+rS....(**)$$ every part is same except unit. in$(*)$, we use 'year' for unit of$t$, and 'month' for$t$in$(**)$solving both equation with initial value, $$S=\frac p r (1-e^{rt})+be^{rt}$$ $$S=\frac q r (1-e^{rt})+be^{rt}$$ suppose I've paid all the money exactly after 20 years. then we have $$0=\frac p r (1-e^{20r})+be^{20r}$$ $$0=\frac q r (1-e^{240r})+be^{240r}$$ simplifying in respect for p and q, $$p=\frac{rb}{1-e^{-20r}} ≒ 17172$$ $$q=\frac{rb}{1-e^{-240r}}≒12000$$ however, $$\frac p {12} = \frac{17172}{12} ≒ 1431.01≠12000=q$$ moreover, my text book says that \$$1431.01 per month is the right answer. this really confuses me. because my first answer was \$$12,000$ per month. what I've done wrong? maybe $e^{-240r}$ is too small? but that's not a good reason for almost 1000% error.

You have to use $r'=\frac{r}{12}$ for the monthly interest rate. So:
$$q=\frac{r'b}{1-e^{-240r'}}=\frac{\frac{rb}{12}}{1-e^{\frac{-240r}{12}}}=1431,01=\frac{p}{12}$$