Juan and Rachel have the same number of marbles. Rachel gives away 10 of her marbles and Juan gives away 22 marbles. Rachel then has 3 times as many marbles a Juan. How many marbles did each of them have at first?

Let's start by assigning letters (or variables for each person)

j = r

Then we have

r - 10 (Rachel gave away 10)

j - 22 (Juan gave away 22)

What we know about the new status of marbles is that r - 10 = 3(j - 22) which means now Rachel (r-10) has 3 times the amount of Juan (j-22)

And since originally r = j, now we can plug in either r or j for the new equation so that we only have one type of variable, and solve for one variable

j - 10 = 3(j - 22)

remove parentheses by multiplying

j - 10 = 3j - 66

subtract j from both sides of equation

-10 = 2j - 66

add 66 to both sides of the equation

56 = 2j

divide both sides by 2

28 = j

and since j = r, then we know r = 28

and check the equation to see if 28 is the correct answer for both Rachel and Juan

28 - 10 = 3(28 - 22)

28 - 10 = 3(6)

18 = 18