If the mortgage interest is compounded monthly, then the monthly rate is 3.5/12% or 3.5/1200=0.002917 approx.
30 years is 30*12=360 months. In 30 years then, $5000 would accumulate to 5000(1.002917)^360=$14266.44, which amounts to $9266.44 interest.
By comparison, the simple interest would be 5000*30*3.5/100=$5250, making the overall amount $10250.
These interest amounts are over 30 years. Taken over 1 year, simple interest would be 5250/30=$175 per year.
The compounded interest divided by 30 would be 9266.44/30=$308.88 average per year.