Given that peaches varied directly as apples. then:
let the number of peaches be p and that of apples be a
hence
p=ka
where
k is constant of proportionality given by:
k=p/a
when:
p=40, a=120
thus
k=40/120=1/3
thus the equation will be:
p=1/3a
thus the number of apples where there are 500 peaches will be:
500=1/3a
multiplying both sides by 3 we get:
500×3=1/3a×3
a=1500