<span>lets assume number of iphones sold = a
number of ipads sold = b
i sold 4 iphones more than ipad that becomes
a = b+4
then the equation of total commission becomes
30a+20b = 520
substituting a =b+4 in the above equation
30(b+4)+20b = 520
30b+120+20b = 520
50b =520-120
50b = 400
b = 400/50
b=8
number of iphones i sold = a = b+4 = 8+4 = 12
number of ipads i sold = 8
so i sold 12 iphones and 8 ipads to earn the commission of $520</span>