$$\frac{\left(\frac{xa^2}{a^2y^2+\ x^2}-p\right)^2}{a^2}+\left(\frac{ya^2}{a^2y^2+\ x^2}-q\right)^2=k^2$$
Could someone please convert this into standard form of equation
$$\frac{\left(X-H\right)^2}{A^2}+\frac{\left(Y-K\right)^2}{B^2}=1$$
I'm almost crying my brains out with all the algebra.
Background: This equation represents the inversion relative to the ellipse $\frac{x^2}{a^2}+{y^2}=1$ of a homothetic ellipse, i.e., of the ellipse $$ \frac{(x-p)^2}{a^2}+(y-q)^2=k^2 $$
Hint: Rewrite the coefficients of $x$ and $y$ into a more recognizable form. That might suggest to you a way to finesse the problem instead of using brute-force algebra.
I’m going to give a general solution because I think that dropping the semi-minor $b$ from the equations obscures their symmetry.
Inverting the ellipse $$\frac{(x-p)^2}{a^2} + \frac{(y-q)^2}{b^2} = k^2$$ relative to $\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$ yields, in standard form, the equation $$ \frac 1{a^2}\left(x-\frac p C\right)^2 + \frac 1{b^2}\left(y-\frac q C\right)^2 = \left(\frac k C\right)^2 $$ where $$ C = \frac{p^2}{a^2} + \frac{q^2}{b^2} - k^2 $$
Derivation: You can save yourself a lot of tedious algebraic manipulation by looking at inversion w/r a circle first.
To review, if $P$ is a point at distance $s$ from the origin, inversion w/r to a circle of radius $R$ centered at the origin maps it to the point $P'$ at a distance $s'$ along the (directed) line $\overrightarrow{OP}$ such that $ss'=R^2$, i.e., $s'=\frac{R^2}s$. This gives the inversion formula $$\eqalignno{ (x,y) \mapsto \left(\frac {R^2x}{x^2+y^2},\frac {R^2y}{x^2+y^2}\right) }$$ A circle of radius $k$ centered at $P$ intersects $\overrightarrow{OP}$ at $s+k$ and $s-k$, which are inverted to $\frac{R^2}{s+k}$ and $\frac{R^2}{s-k}$, respectively. Note that these values can be negative. The center of the circle’s image under inversion will be at their midpoint—not at the inversion of its center—with radius $k'$ equal to half the distance between them: $$\eqalign{\tag 1 k'=\frac 12\left(\frac{R^2}{s-k}-\frac{R^2}{s+k}\right) = \frac{R^2}{s^2-k^2}k \\ P' = \frac{R^2}{s+k} + k' = \frac{R^2}{s^2-k^2}s }$$ Let $C=\frac{s^2-k^2}{R^2}=\frac{p^2+q^2-k^2}{R^2}$ and $R=1$. Using the inversion formula we have for the equation of the circle’s image: $$ \left(\frac {x}{x^2+y^2}-p\right)^2+\left(\frac {y}{x^2+y^2}-q\right)^2=k^2 $$ but by $(1)$ this must be equivalent to $$\eqalign{\tag 2 \left(x-\frac p C\right)^2+\left(y-\frac q C\right)^2 = \left(\frac k C\right)^2 }$$ We can turn this into inversion relative to the ellipse $\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$ by mapping to a coordinate system with $x$ and $y$ scaled by $a$ and $b$, respectively. The above considerations still hold, except that now the appropriate metric to use is $$ s^2 = \frac{x^2}{a^2}+\frac{y^2}{b^2} $$ so $$C=\left(\frac x a\right)^2+\left(\frac y b\right)^2-k^2$$ and the equation of the image of the ellipse $$\frac{(x-p)^2}{a^2}+\frac{(y-q)^2}{b^2}=k^2$$ is $$ \frac1{a^2}\left(\frac {x}{\frac{x^2}{a^2}+\frac{y^2}{b^2}}-p\right)^2+\frac1{b^2}\left(\frac {y}{\frac{x^2}{a^2}+\frac{y^2}{b^2}}-q\right)^2=k^2 $$ which by analogy to $(2)$ is $$ \frac1{a^2}\left(x-\frac p C\right)^2+\frac1{b^2}\left(y-\frac q C\right)^2 = \left(\frac k C\right)^2 $$