<s>[INST] Length of a perpendicular bisector to a line intersecting a curve The line $x+y-2=0$ intersects the curve $2x^2-y^2+2x+1=0$ at the points $A$ and $B$. The perpendicular bisector of the line $AB$ intersects the curve at the points $C$ and $D$. Find the length of the line $CD$ in the form $a\sqrt5$, where $a$ is an integer.
This was a question from a recent exam for IGCSE Additional Mathematics, and here are my steps:
$$y = -x+2$$
Substitute into the equation of the curve:
$$2x^2 - (-x+2)^2+2x+1=0$$
$$2x^2 - (x^2-4x+4) + 2x + 1 = 0$$
$$x^2+6x-3=0$$
$$x = \frac{-6 ± \sqrt{(6)^2-4(1)(-3)}}{2}$$
$$= 2\sqrt{3}-3, -2\sqrt{3}-3$$
$$y = -2 \sqrt{3} + 5, 2\sqrt{3}+5$$
The slope of $AB$ is $\frac{(-2\sqrt{3}+5) - (2 \sqrt{3} + 5)}{(2\sqrt{3}-3) - (-2\sqrt{3}-3)} = \frac{-4\sqrt3}{4\sqrt3} = -1$, so the slope of the perpendicular bisector is $1$. 
The midpoint of $AB$ is $\left(\frac{(2\sqrt{3}-3) + (-2\sqrt{3}-3)}{2}, \frac{(-2\sqrt{3}+5) + (2 \sqrt{3} + 5)}{2} \right) = (-\frac{6}{2}, \frac{10}{2} = (-3, 5)$. The perpendicular bisector can be written in the form $y = x + c$, and with $x = -3, y=5$, we have $c = 8$. Therefore, $y = x+8$.
To find $C$ and $D$, we have:
$$2x^2-(x+8)^2 + 2x + 1 =0 $$
$$2x^2-(x^2+16x+64) + 2x+1=0$$
$$x^2-14x-63=0$$
$$x = \frac{-(-14) ± \sqrt{(-14)^2-4(1)(-63)}}{2}$$
$$= 7 + 4\sqrt7, 7 - 4\sqrt7$$
$$y = 15 + 4\sqrt7, 15 - 4\sqrt7$$
Therefore the distance between $C$ and $D$ is:
$$\sqrt{\left((7 + 4\sqrt7) - (7 - 4\sqrt7)\right)^2 + \left((15 + 4\sqrt7) - (15 - 4\sqrt7)\right)^2}$$
$$= \sqrt{(8\sqrt7)^2 + (8\sqrt7)^2}$$
$$= 8\sqrt{14}$$
but my answer is not in the form $a\sqrt5$. 
Is my answer correct? If not, I would be happy to receive an alternate solution or a correction to my work.
 [/INST] Sorry if this answer is too short.
I think it should have been $x+y+2=0$. That gives a distance that is a multiple of $\sqrt 5$.
I checked after your comment about it being $x-y+2=0$. That also gives a multiple of $\sqrt 5$ - the same, curiously, as for $x+y+2=0$.
On second thoughts, not that curious. The lines $x+y+2=0$ and $x-y+2=0$ are reflections of each other in the $x$-axis and the curve is symmetrical about the $x$-axis, too.
</s>