Question 769604
john age x
james age =y

y-x=3......................(1)

y=x+3

(x+3)(y+3)=270..............(2)

xy+3x+3y+9=270

substitute y
x(x+3)+3x+3(x+3)+9=270

x^2+3x+3x+3x+9+9=270
x^2+9x+18=270

x^2+9x-252=0

x^2+21x-12x-252=0
x(x+21)-12(x+21)=0

(x+21)(x-12)=0

x= -21 OR 12

age cannot be negative so x=12

The ages are 12 & 15