<s>[INST] Foci of ellipse My question is given a ellipse of the equation : $$\frac{x^2}{a^2}+\frac{y^2}{b^2} =1$$ where $a>b$ then how we can find the coordinates of the foci. I want to find those coordinates without the presuming that the foci exists because most proofs I found online assume the properties of foci to be true and then take some extreme case to find foci's coordinates.
So to rephrase my question: Given a closed curve of the equation $$\frac{x^2}{a^2}+\frac{y^2}{b^2} =1$$ prove that there exists two points inside the curve such that if we take any point on the boundary of the curve and join it to those two points then the sum of those lengths will give a fixed constant based on $a$ and $b$ (Assume $a>b$).
Here's my attempt which gave me nothing:
Let's take a point $P$ on the curve as $\left(x,\  b\sqrt{1-\frac{x^2}{a^2}}\right)$
Let those two points be $(-f,0)$ and $(f,0)$ then the sum of lengths from point $P$ becomes
$$S = \sqrt{(f+x)^2+b^2\left(1-\frac{x^2}{a^2}\right)}+\sqrt{(f-x)^2+b^2\left(1-\frac{x^2}{a^2}\right)}$$
Differentiating this wrt to $f$ and equating to $0$ to find the stationary case
$$\dfrac{f+x}{\sqrt{\left(f+x\right)^2+b^2\left(1-\frac{x^2}{a^2}\right)}}+\dfrac{f-x}{\sqrt{\left(f-x\right)^2+b^2\left(1-\frac{x^2}{a^2}\right)}}=0$$
Squaring and simplifying
$$4bfx\left(1-\frac{x^2}{a^2}\right)=0 \implies f =0$$
which is obviously wrong...
Note that in my attempt I too assumed two points, that the foci will be symmetrical and on the major axis, if we can even take these assumptions out that would be amazing. It's just that with these assumptions I was able to at least start somewhere.

P.S.
$\textbf{thanks to the comments by @Blue}$
differentiating $S$ wrt $x$ and equating to zero
$$\dfrac{2\left(x+f\right)-\frac{2b^2x}{a^2}}{2\sqrt{\left(x+f\right)^2+b^2\cdot\left(1-\frac{x^2}{a^2}\right)}}+\dfrac{-\frac{2b^2x}{a^2}-2\left(f-x\right)}{2\sqrt{b^2\cdot\left(1-\frac{x^2}{a^2}\right)+\left(f-x\right)^2}}=0$$
Squaring and simplifying
$$ a^4b^2fx(f^2-(a^2-b^2))=0$$
So,
$$f= \sqrt{a^2-b^2}$$
 [/INST] *

*Find the eccentricity of the ellipse.

$$e=\sqrt{1-\dfrac{b^2}{a^2}}$$


*Now you have the following expressions to find the coordinates of the foci:

$$\begin{align*}
F_1 &= \left(ae, 0\right) = \left(a\sqrt{1-\dfrac{b^2}{a^2}}, 0\right),\\
F_2 &= \left(-ae, 0\right) = \left(-a\sqrt{1-\dfrac{b^2}{a^2}}, 0\right).
\end{align*}$$
What's even more wonderful, it works for any kind of ellipse.
</s>