The sum of a certain infinite geometric series is 2. The sum of the squares of all the terms is 4. Find the common ratio.

I think there is a mistake in your question !!! The sum of the squares cannot be 4. I think it should be 3. Check your numbers carefully.