1. Use the distance formula between points \((a, 2)\) and \((3, b)\):
\(\sqrt{(a - 3)^2 + (2 - b)^2} = \sqrt{125}\)
Squaring both sides:
\((a - 3)^2 + (2 - b)^2 = 125\)
2. Use the gradient formula for the line \(AB\):
\(\frac{2 - b}{a - 3} = 2\)
Rearrange to find \(b\):
\(2 - b = 2(a - 3)\)
\(b = 2 - 2a + 6\)
\(b = 8 - 2a\)
3. Substitute \(b = 8 - 2a\) into the distance equation:
\((a - 3)^2 + (2 - (8 - 2a))^2 = 125\)
\((a - 3)^2 + (2a - 6)^2 = 125\)
4. Expand and simplify:
\((a - 3)^2 + (2a - 6)^2 = 125\)
\((a^2 - 6a + 9) + (4a^2 - 24a + 36) = 125\)
\(5a^2 - 30a + 45 = 125\)
\(5a^2 - 30a - 80 = 0\)
5. Factorize:
\(5(a^2 - 6a - 16) = 0\)
\(5(a + 2)(a - 8) = 0\)
6. Solve for \(a\):
\(a = -2\) or \(a = 8\)
7. Substitute back to find \(b\):
If \(a = -2\), \(b = 8 - 2(-2) = 12\)
If \(a = 8\), \(b = 8 - 2(8) = -8\)
Thus, the possible values are \(a = -2\) or \(8\), \(b = 12\) or \(-8\).