# How to transform elliptic equation and hyperbola equation into standard form?

The elliptic trajectory equation and hyperbola trajectory equation are generated according to the code, but the final form is not the standard form. How to generate the standard equation form?

The standard forms of elliptic equation and hyperbola equation are:

x^2/a^2 + y^2/b^2 == 1

x^2/a^2 - y^2/b^2 == 1


the first one Elliptical trajectory equation:

Clear["Global*"]
expr = EuclideanDistance[{0, 4}, {x, y}] +
EuclideanDistance[{0, -4}, {x, y}] == 10
eq1 = Refine[Simplify[expr],
Assumptions -> {x \[Element] Reals, y \[Element] Reals}] //
FullSimplify
eq2 = SubtractSides[eq1, FirstCase[List @@ First@eq1, Sqrt[__]]]
eq3 = ApplySides[#^2 &, eq2] // Expand
eq4 = Apply[Subtract, eq3] == 0
eq5 = SubtractSides[eq4, FirstCase[List @@ First@eq4, k_*Sqrt[__]]]
eq6 = ApplySides[#^2 &, eq5] // Simplify


the result is:

25 x^2 + 9 y^2 == 225


The standard equation form is:

x^2/5+y^2/25==1


the second Hyperbola trajectory equation：

Clear["Global*"]
expr = EuclideanDistance[{0, 2}, {3, 2}] -
EuclideanDistance[{0, -2}, {3, 2}] ==
EuclideanDistance[{0, -2}, {x, y}] -
EuclideanDistance[{0, 2}, {x, y}]
eq1 = Refine[Simplify[expr],
Assumptions -> {x \[Element] Reals, y \[Element] Reals}]
eq2 = ApplySides[#^2 &, eq1] // Simplify
eq3 = Fold[SubtractSides, eq2, Cases[List @@ First@eq2, Sqrt[__]]]
eq4 = ApplySides[#^2 &, eq3] // Simplify


the result is :

3 + x^2 == 3 y^2


The standard equation form is:

y^2-x^2/3==1


The results obtained are not in the form of standard equations. How can we obtain the standard equation?

• Define "standard equation." Commented Apr 19, 2023 at 15:31
• @DavidG.Stork The standard "standard equation" in US math ed has the form of a sum/difference of squares equals the number one. I don't know how standard that terminology is outside the US. Since this is an international site, perhaps, @ csn889, you could edit the question to make it clear. Commented Apr 19, 2023 at 17:02
• Your ApplySides statements are determining the final form of the equations. Why not use ApplySides to get the equations the way you want? Commented Apr 19, 2023 at 17:10
• @csn889, you have now posted around 10 different partial questions on the manipulation of ellipse equation, and the last few of them are just concatenating the code from previous answers. Can you please clearly state what is you overall final goal with these conic sections? Are you doing this for educational purposes, and want to show the derivation of the standard form? Do you just want the parameters of the standard form? Note that there are also several questions already about quadratic forms: Commented Apr 19, 2023 at 19:14
• Commented Apr 19, 2023 at 19:14

expr1 = EuclideanDistance[{0, 4}, {x, y}] + EuclideanDistance[{0, -4}, {x, y}] == 10;
expr2 = EuclideanDistance[{0, 2}, {3, 2}] - EuclideanDistance[{0, -2}, {3, 2}] ==
EuclideanDistance[{0, -2}, {x, y}] - EuclideanDistance[{0, 2}, {x, y}];

expr1

Refine[%, Assumptions -> {x, y} ∈ Reals]

% /. s1_Sqrt[__] + s2_Sqrt[__] == a_ :> s1 == a - s2

ApplySides[#^2 &, %] // Expand

SubtractSides[%]

% /. a_ + (s : _.*Sqrt[__]) == 0 :> a == -s

ApplySides[#^2 &, %] // Simplify

SubtractSides[%]

% /. (a_?NumberQ + b_ == 0) :> b == -a

DivideSides[%] // Expand


$$\frac{x^2}{9}+\frac{y^2}{25}=1$$

expr2

(* ... same code as above ... *)


$$-\frac{x^2}{3}+y^2=1$$

How to optimize the code for deriving the standard equation of the Apollonian circle?

Based on xzczd's solution therein:

ClearAll["*"]
eq = 25 x^2 - 9 y^2 == 225
Apply[Subtract]@eq
rule = Solve[
ForAll[{x, y},
Apply[Subtract]@eq ==
dd ((x - aa)^2/ff + (y - bb)^2/gg - 1)], {aa, bb, cc, dd, ee, ff,
gg}][[1]]
(x - aa)^2/ff + (y - bb)^2/gg == 1 /. rule
`