Missing information in the text of the problem: q3=3 q1 = 3q
We can solve the problem by solving a system of two equations. In the first one, we write that the electrostatic force between charge 1 and 2 is equal to the force between charge 2 and 3. In the second equation, we write that the sum of the distances q1-q2 and q2-q3 is equal to 42 cm:


From the second equation we write

While we can rewrite the first equation as

Substituting and solving, we find

or

. With the first solution,

would be negative, which doesn't make sense; therefore we must consider only the second solution, and we have:

