Explanation:
: Let the age of Ram = X years
Age of Shyam = Y years
According to question
XY= 240 …………eq.1
And, 2X = Y + 4
Y= 2X- 4
Y = 2(X-2) ……………eq.2
Now putting the value of eq.2 in eq.1
X ×[ 2(X-2)] = 240
X × (2X – 4) =240
2X2 – 4X =240
X2– 2X = 120
X2 – 2X – 120 = 0
Doing the factors of above equation:
X2 – (12-10)X – 120 = 0
X2 -12X + 10X -120 = 0
X(X-12) + 10(X-12) = 0
(X-12) (X+10) = 0
X+10 = 0, X-12 = 0
X= -10, X = 12
Therefore Ram’s age is 12 years.