The distance between $A$ and $B$ is $\sqrt{(a - 2)^2 + (-1 - (2a - 1))^2} = \sqrt{(a - 2)^2 + (-2a)^2}$. Squaring both sides, we get
\[(a - 2)^2 + 4a^2 = 5.\]This simplifies to $5a^2 - 4a - 1 = 0.$ Note that $5a^2 - 4a - 1 = (5a + 1)(a - 1),$ so the possible values of $a$ are $1$ and $-\frac{1}{5}.$
Therefore, the sum of all possible values of $a$ is $1 + \left( -\frac{1}{5} \right) = \boxed{\frac{4}{5}}.$
The distance between the points $A$ and $B$ is $\sqrt{5}.$ If $A = (a,-1)$ and $B = (2,2a-1),$ then find the sum of all possible values of $a.$
1 answer