Rakesh says to sajani, "I am twice as old as you were when I was as old as you are.". If the sum of their present ages is 49 years, find the present ages.
My attempt. Let the present age of Rakesh be $x$ years and the present age of Sajani be $y$ years.
According to question:. $$x=2[y-(x-y)]$$.
Also, $x+y=49$.
Is my statement correct according to the condition given in the question?
Yes it is. Now all you have to do is solve it for $x $ and $y $!
I will break it down for other people that read my answer.
Rakesh says "I am twice as old as you were when I was as old as you are."
Let $x $ be how old Rakesh is and $y $ the age of Sajani.
We know that $x + y = 49$.
Now we parse Rakesh's sentence bit by bit! "I am twice as old".
Because he says "am", the present tense, he is talking about his age today, which is $x $. He says that age is twice some number. Therefore
$$x = 2 \times [ some\ number ] $$
The "as you were" indicates that we are going to talk about Sajani's age some time ago. Note that Sajani's age, "some time ago" is given by $y - (how\ many\ years\ passed) $
So we just have to check how much time has passed. And then they say "when I was as old as you are". So when was Rakesh as old as Sajani is? Sajani is $y $ years old and Rakesh is $x $ so if from $x $ we subtract $(x-y) $ we get $y $ that is, $x-y $ years ago Rakesh was as old as Sajani is. Then we look back at "as old as you were some time ago". We know that some time ago is $x-y $, so $x-y $ years ago Sajani was $y - (x - y) $ years old. Now we plug this as the "some number" to get
$$x = 2 \times [y - (x - y)] $$
Simplifying we get
$$x = 2 (2y + x) \iff x = 4y - 2x \iff 3x = 4y \iff \frac {3}{4}x = y$$ But $$x + y = 49 \iff x + \frac {3}{4}x = 49 \iff \frac {7}{4}x = 49 \iff x = \frac {4}{7}49 = 28$$
And it follows that $y = 21$.