Maximising interest earned from banks I am now faced with a problem that I cant seem to obtain an answer for.
Context: I have 20000 saved up now.
There are 2 banks. Bank A and Bank B. Bank A offers a 2% p.a. compounded monthly, up till the first 20000, then it's 2% p.a. simple interest (monthly payouts) on the 20000 and then a measly small 0.1% pa compounded monthly for the amounts after 20000. Eg if I have $20001, $20000 will be 2% pa (simple interest) then $1 will be 0.1% pa. (Compounded monthly) 
Bank B offers 1% p.a. (compounded monthly) compound interest. No conditions. 
I have been putting all my monthly salaries into growing that cash in Bank A to 20000. But now, what would be the best way to grow more money? I thought about putting my 20000 in Bank A and putting my extra monthly salaries + the simple interest from Bank A into Bank B. But with this method, I feel that I am not making full use of the 2% p.a. compound interest for Bank A. 
How can I solve this mathematically? There are like quite a few variables so it's like 3 dimensional graphs I'm plotting and I haven't learn differentiation to find maximum points for 3d graphs.... 
 A: Effectively, you have three accounts: 


*

*A1 earns 2% per annum always, but is capped at $20,000$. 

*A2 earns 0.1% per annum, but is unlimited. It represents any money you have in A above $20,000$.

*B earns 1% per anum, and is also unlimited.


Every month, the banks pay out however much interest each account earns and you must distribute it. "Compounding" only means the bank is willing to take care of some of this distribution automatically for you, if you are willing (and if you are not willing, you have to take care of moving the funds around manually from where they put it).
Thought of in this way, what you need to do to maximize earnings is obvious: A1 gives the best rate, so as long as you can, put all your money in it. But once it is full, it is full. Any additional funds available to you have to go somewhere else. And obviously, that somewhere else should be B, not A2.
So leave $20,000$ in Bank A, and put everything else in Bank B. Anytime you see more than $20,000$ in A, move it to $B$ where it can earn more money.
