<s>[INST] How to find the longest chord of the ellipse $\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$ passing through $(0,-b)$? Let $\dfrac{x^2}{a^2}+\dfrac{y^2}{b^2}=1$ be an ellipse. How to find the longest chord in such ellipse which passes through the point $(0,-b)$ when

*

*$\ a> \sqrt{2}b>0$,


*$\ 0<a\leq \sqrt{2}b$
Frankly I do not even know what should I use. Is using the formula for the distance between two points and than maximization the expression a good idea? How the cases affect the solution?
 [/INST] Let $(x_1,y_1)$ be the coordinates of the other end of the chord, with $x_1>0$ (the solution is symmetric with respect to $y$-axis, so this is not a limitation).
The condition to impose is: the tangent in $(x_1,y_1)$ should be orthogonal to the chord. The tangent is
$$
t:\ \frac{xx_1}{a^2}+\frac{yy_1}{b^2}=1
$$
A vector normal to the tangent is given from the coefficients of variables $x,y$ in the cartesian equation of the line,
$$
\mathbf{n}_t=\left(\frac{x_1}{a^2},\frac{y_1}{b^2}\right)
$$
while a directional vector of the line, orthogonal to $\mathbf{n},$ is
$$
\mathbf{u}_t=\left(-\frac{y_1}{b^2},\frac{x_1}{a^2}\right)
$$
The parametric equations of the line on which the chord lies is
$$
\begin{alignedat}{2}
x &= &&0+(x_1-0)t,\\
y &= -&&b+(y_1+b)t.
\end{alignedat}
$$
This is built with the formula for the parametric equations of the line through two points $A=(x_A,y_A)$ and $B=(x_B,y_B)$:
$$
c:\ \left\{
\begin{alignedat}{2}
x &= x_A+(x_B-x_A)t,\\
y &= y_A+(y_B-y_A)t.
\end{alignedat}
\right.
$$
Its directional vector is given by the coefficients of the parameter $t$
$$
\mathbf{u}_c=(x_1,y_1+b).
$$
The orthogonality condition
$$
\mathbf{u}_t\cdot\mathbf{u}_c=0
$$
gives
$$
-\frac{x_1y_1}{b^2}+\frac{x_1(y_1+b)}{a^2}=0
$$
and when $x_1\neq0$ we have
\begin{align}
y_1 &= \frac{b^3}{a^2-b^2}\\
x_1 &= a\sqrt{1-y_1^2/b^2}=\frac{a^2\sqrt{a^2-2b^2}}{a^2-b^2}
\end{align}
The square root requires $a\geq\sqrt{2}b>b.$
The length of the arc is
$$
l=\frac{a^2}{\sqrt{a^2-b^2}}.
$$
When $0<a\leq\sqrt{2}b$ the only solution is for $x_1=0$ and the chord is the vertical one.
This is an animation for fixed $b$ and $a$ decreasing

</s>