The question is as follows:
The vertices of an ellipse are $(9,0)$ and $(-9,0)$, and the $y$-intercepts of the ellipse are $5$ and $-5$. Write an equation for the ellipse.
After doing some calculations I found the foci to be $(-4\sqrt{14}, 0)$ and $(4\sqrt{14}, 0)$.
We haven't been taught to use the intercepts and put that into the formula of a generic ellipse. But what we have been taught is that given any point $P = (x, y)$ on the ellipse, $PF_1 + PF_2 = 2a$, where $F_1$ and $F_2$ are the two focal points and $a$ is distance from the center to one of the vertices on the major symmetry axis.
Using the distance formula I know that $PF_1 = \sqrt{(x + 4\sqrt{14})^2 + y^2}$ and $PF_2 = \sqrt{(x-4\sqrt{14})^2 + y^2}$. $$ \sqrt{(x + 4\sqrt{14})^2 + y^2} + \sqrt{(x-4\sqrt{14})^2 + y^2} = 18$$
I did the following steps to simplfy to find the equation of the ellipse in the form of $hx^2 + ky^2 = m$.
$$ \sqrt{(x + 4\sqrt{14})^2 + y^2} = 18 + \sqrt{(x-4\sqrt{14})^2 + y^2} $$
After squaring both sides...
$$ (x + 4\sqrt{14})^2 + y^2 = 324 - 36\sqrt{(x-4\sqrt{14}) + y^2} + (x-4\sqrt{14})^2 + y^2 $$ $$ x^2 + 8\sqrt{14}x + 56 - 324 - (x-4\sqrt{14})^2= - 36\sqrt{(x-4\sqrt{14})}$$ $$ x^2 + 8\sqrt{14}x + 56 - 324 - (x^2 - 8\sqrt{14}x + 224)= - 36\sqrt{(x-4\sqrt{14})^2}$$
From this point I am seeing terms that I can't cancel out to get $hx^2 + ky^2 = m$ (e.g. $8\sqrt{14}x + 8\sqrt{14}x = 16\sqrt{14}$). Also, expanding the right side of the equation will lead to even larger terms because I have to multiply them by $(-36)^2$. Where am I making a mistake? Any help will be greatly appreciated.