A problem while deriving the equation of an ellipse While deriving the equation of an ellipse,
let $0 < k < a$, $(x, y) \in R ^ 2$
(1): $\sqrt{(x + k) ^ 2 + y ^ 2} + \sqrt{(x - k) ^ 2 + y ^ 2} = 2a$
(2): $\sqrt{(x + k) ^ 2 + y ^ 2} = 2a - \sqrt{(x - k) ^ 2 + y ^ 2}$
(3): $(\sqrt{(x + k) ^ 2 + y ^ 2}) ^ 2 = (2a - \sqrt{(x - k) ^ 2 + y ^ 2}) ^ 2$
(4): $a \sqrt{(x - k) ^ 2 + y ^ 2} = a ^ 2 - kx$
The 4 equations above are all equivalent because,


*

*(1)(2) and (3)(4) only have simple arithmetic applied, thus (1) $\Leftrightarrow$ (2) and (3) $\Leftrightarrow$ (4)

*Since both sides in (2) are $\ge$ 0, (2) $\Leftrightarrow$ (3)


Having 2 sets $A$ and $B$ defined as follows,
$A = \{(x, y)|f(x, y) = g(x, y)\}$
$B = \{(x, y)|f(x, y)^2 = g(x, y)^2\} = \{(x, y)|(f(x, y) + g(x, y))(f(x, y) - g(x, y)) = 0\}$
$A \subset B$
$A = B$ if $f(x, y) \ge 0$ and $g(x, y) \ge 0$
This explains (2) $\Leftrightarrow$ (3).
My book goes further from (4) that,
(5): $(a \sqrt{(x - k) ^ 2 + y ^ 2}) ^ 2 = (a ^ 2 - kx) ^ 2$
(6): $(a ^ 2 - k ^ 2) x ^ 2 + a ^ 2 y ^ 2 = a ^ 2 (a ^ 2 - k ^ 2)$
(7): $b ^ 2 = (a ^ 2 - k ^ 2), b > 0, b ^ 2 x ^ 2 + a ^ 2 y ^ 2 = a ^ 2 b ^ 2$
(8): $\frac{x ^ 2}{a ^ 2} + \frac{y ^ 2}{b ^ 2} = 1, a > b > 0, k ^ 2 = a ^ 2 - b ^ 2$
It's clear to me that from (5) to (8) are all equivalent statements, that when plotted on $R ^ 2$ with $(x, y)$ pairs that satisfy those statements, they will all be the same curve.
But it's not clear to me why (4) $\Leftrightarrow$ (5)? For them to be equivalent, both sides of (4) should be $\ge$ 0. But apparently the right side of (4) can anytime be negative when $x$ is big enough.
Could you please clarify?

In order for $x\gt k$ to be max in (1), $y=0$ is needed. Then, solving 
$$x+k+x-k=2a$$
gives you $x=a$. This implies that $x\le a$. Hence, since $0\lt k\lt a\Rightarrow 1\lt\frac ak\Rightarrow a\lt\frac{a^2}{k}$, one has
$$x\le a\lt\frac{a^2}{k}\Rightarrow a^2-kx\gt 0.$$
So, (4)$\iff$(5).
