<s>[INST] Finding the equation of an hyperbola if the distance between its directrices is $\frac83$ and its eccentricity is $\frac32$ I have this problem:

Find the canonical equation of an hyperbola if the distance between the directrices is $\frac{8}{3}$ and the eccentricity $e=\frac{3}{2}$.

How would you solve it?
This is my try:
The canonical equation of a hyperbola takes the form $x^2/a^2 - y^2/b^2 = 1$, and the foci are at a distance $c > a$ from the origin, and our directrices are located at $a^2/c$, where eccentricity is $\sqrt{a^2+b^2}/a$. If $e = 3/2$, then
\begin{align}
\frac{\sqrt{a^2+b^2}}{a} = \frac32 
&\implies \frac32 a = \sqrt{a^2+b^2} \\[4pt]
&\implies \frac94 a^2 = a^2 + b^2 \\[4pt]
&\implies a^2\left(\frac94 - 1\right) = b^2 && (c^2 = a^2 + b^2)
\end{align}
so
\begin{align}
a^2 + a^2\left(\frac94-1\right) = c^2 
&\implies c^2 = a^2\left(1 + \frac94 - 1\right) \\[4pt]
&\implies c^2 = \frac94 a^2 \\[4pt]
&\implies c = \frac32 a
\end{align}
so our directrix is located at
$$\frac{a^2}{c} = \frac{a^2}{a\cdot 3/2} = \frac{a}{3/2} = \frac{2}{3}\cdot a,$$
but the distance between directrices is $8/3$, so it's double the distance from the origin, so essentially,
$$ \frac{8}{3} = 2x = 2\cdot \frac{2}{3} \cdot a
\implies \frac{8}{3} = \frac{4}{3} \cdot a
\implies a = 2. $$
And since
$$ c^2 - a^2
= b^2
= \frac{9}{4} \cdot 4^2 - 4^2
= 16 \left( \frac{9}{4} - 1\right)
= 4 \cdot 9 - 16
= 36-16
=20. $$
In total, we have
$$a^2 = 4, \qquad\text{and}\qquad b^2 = 20,$$
which results in the canonical form
$$\frac{x^2}{4} -\frac{y^2}{20} = 1.$$
Also, how would you find the eccentricity of an ellipse if the sides of the square inscribed in it pass through the foci of the ellipse?
My try:
Let’s imagine a generic ellipse, and the square inside has its sides located at $-x$ and $x$, making the side of the square $2x$, and we know that the foci occur at
$$ x = \frac{a^2}{c}
\quad\text{so}\quad
2x = \frac{2a^2}{c},
\qquad\text{(since $c^2 = a^2 + b^2$)},$$
and eccentricity is
$$ \frac{\sqrt{a^2 + b^2}}{a} = \frac{c}{a}, $$
so if $ e = c/a $ and
$$ 2x = \frac{2a^2}{c} = 2a \cdot \frac{a}{c} = 2a\cdot \frac{1}{e} = \frac{2a}{2}
\implies x = \frac{a}{2}
\implies e = \frac{a}{x}
$$
and $x$ would be half the side of the square in this case.
 [/INST] In the hyperbola exercise, you double-squared the $a$ in your $c^2-a^2 = \cdots = 20$ calculation, effectively multiplying everything by an extra factor of $4$. You should get $9-4=5$, instead.

Here's a clearer path to the solution:
If the hyperbola's transverse semi-axis is $a$, its center-to-focus distance is $c$, and its eccentricity is $e$, then the center-to-directrix distance (call it $d$) is indeed given by $d=a^2/c$, so that (since $e=c/a$) we can write $a = de$.
Since the distance between the directrices is $8/3$, we have $d=4/3$; given the eccentricity $3/2$, we have
$$a = de=\frac43\cdot\frac32=2 \tag{1}$$
Then,
$$c=ae = 2\cdot\frac32=3 \tag{2}$$
and then
$$b^2=c^2-a^2=9-4=5\tag{3}$$
so that, for an origin-centered hyperbola with a horizontal transverse axis, the equation is
$$\frac{x^2}{a^2}-\frac{y^2}{b^2}=1 \quad\to\quad \frac{x^2}{4}-\frac{y^2}{5}=1 \tag{$\star$}$$

(I think the ellipse question should be posted separately, so I won't address it here.)
</s>