We are told that the principle is the same for both investments so we can say:
315=P(r+4)/100 and 175=Pr/100 solving both for P you have:
P=31500/(r+4) and P=17500/r since P=P:
17500/r=31500/(r+4)
175(r+4)=315r
175r+700=315r
-140r+700=0
-140r=-700
r=5
So the rates are 5% and (5+4)=9%
check...
P(9/100)=315 and P(5/100)=175
P=31500/9 and P=17500/5
P=157500/45 and P=157500/45
So P=P
note: P=$3500
3500(9/100)=$315
3500(5/100)=$175