Decide the length of your investment period. If it is 12 years or longer, then the account earning compound interest will pay more.
Explanation:
The account balance (A) in the simple interest account will be the principal amount (P) added to the interest earned.
A = P + P·0.05·t = P(1+.05t)
Assuming the interest is compounded annually, the account balance in the compound interest account will be the principal amount multiplied by the factor representing the growth due to interest.
A = P(1 +0.04)^t = P·1.04^t
After some number of years, the second account balance will exceed the first account balance. That number of years cannot be found algebraically, but it can be found by graphing or by trial-and-error. It can be found to be about 11.919 years, or about 11 years and 11 months.
If interest is compounded more often than once per year, the break-even point will shorten slightly. It will never be shorter than 10.77 years (compounded continuously).