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

(J-22)*3=(R-10)

but J=R originally, so
3R-66=R-10
2R=56
R= ...

(x - 10) = 3(x - 22)

(x - 10) = 3x - 66 | Since 3 times x = 3x and 3 times 22 = 66
x - 3x = 10 - 66
- 2x = - 56
x = 28

Let's suppose that both Juan and Rachel had "x" marbles at first.

After Rachel gives away 10 marbles, she will have x - 10 marbles.

After Juan gives away 22 marbles, he will have x - 22 marbles.

Given that Rachel has 3 times as many marbles as Juan, we can write the equation:

x - 10 = 3(x - 22)

Now let's solve the equation:

Distribute the 3 on the right side of the equation:
x - 10 = 3x - 66

Move the x term to the left side by subtracting x from both sides:
-10 = 2x - 66

Add 66 to both sides:
56 = 2x

Divide both sides by 2:
x = 28

Therefore, both Juan and Rachel had 28 marbles at first.

Let's break down the problem step by step to figure out how many marbles each of them had originally.

Let's assume the number of marbles both Juan and Rachel had at first is "x".

After Rachel gives away 10 marbles, she is left with "x - 10" marbles.
After Juan gives away 22 marbles, he is left with "x - 22" marbles.

According to the problem, Rachel has 3 times as many marbles as Juan. So we have the equation:

x - 10 = 3(x - 22)

Let's solve this equation to find the value of x:

x - 10 = 3x - 66

Now, subtract "x" from both sides:

-10 = 2x - 66

Next, add 66 to both sides:

66 - 10 = 2x

Simplifying further:

56 = 2x

Finally, divide both sides by 2 to solve for x:

x = 56 / 2
x = 28

Therefore, both Juan and Rachel originally had 28 marbles.