R + B = Y
B^2 = R
B^2 + R = Y + 12
Y/B = R - 11
B^3 = 4Y - R
Look at these this line:
B^2 = R
In the other lines replace all Rs with B^2:
B^2 + B = Y
B^2 + B^2 = Y + 12
Y/B = B^2 - 11
B^3 = 4Y - B^2
Let's re-word the third line:
B^2 + B = Y
B^2 + B^2 = Y + 12
Y = B^3 - 11B
B^3 = 4Y - B^2
See the first line? Let's replace all of the Ys with B^2 + B:
B^2 + B^2 = B^2 + B + 12
B^2 + B = B^3 - 11B
B^3 = 4(B^2 + B) - B^2
Simplify:
2B^2 = B^2 + B + 12
B^2 = B^3 - 12B
B^3 = 4B^2 + 4B - B^2
More simplifying:
B^2 = B + 12
B^2 = B^3 - 12B
B^3 = 3B^2 + 4B
Consider the first line:
B^2 = B + 12
Move everything to one side:
B^2 - B - 12 = 0
Same as:
(B - 4) (B + 3) = 0
B has to equal 4 or -3.
You can't have negative 3 of a thing, so B = 4
Consider the other two lines:
B^2 = B^3 - 12B
B^3 = 3B^2 + 4B
Check those to make sure B = 4 works.
4^2 = 4^3 -12*4 >> 16 = 64 - 48 >> Yes.
4^3 = 3*4^2 + 4*4 >> 64 = 48 + 16 >> Yes.
Remember how we said B^2 + B = Y ? Now that we know B = 4, we can do this:
4^2 + 4 = Y
16 + 4 = Y
Y = 20
Remember how we said B^2 = R ? Now that we know B = 4, we can do this:
4^2 = R
R = 16
Answer: 16 red, 4 blue, 20 yellow.