# How to perform item shifting deformation?

How to subtract the two equations. That is, the left subtraction of the two equations is equal to the right subtraction of the equation

Continue to the previous question, how to perform the term shift deformation?

eq1 = x1^2/a^2 + y1^2/b^2 == 1;
eq2 = x2^2/a^2 + y2^2/b^2 == 1;
SubtractSides[eq1, eq2] // FullSimplify


get the result:

((x1 - x2) (x1 + x2))/a^2 + ((y1 - y2) (y1 + y2))/b^2 == 0


The problem now is how to shift the above results to get this result:

((y1 - y2) (y1 + y2))/((x1 - x2) (x1 + x2)) == - b^2/a^2


eqA = ((x1 - x2) (x1 + x2))/a^2 + ((y1 - y2) (y1 + y2))/b^2 == 0;


Try the following:

eqB = eqA /. b -> Sqrt[z]*a // Simplify[#, {a > 0, z > 0}] &

(*  y1^2 + x1^2 z == y2^2 + x2^2 z  *)

Equal @@ Solve[eqB, z][[1, 1]] /. z -> b^2/a^2

(*  b^2/a^2 == (-y1^2 + y2^2)/(x1^2 - x2^2)  *)


Have fun!

eq1 = x1^2/a^2 + y1^2/b^2 == 1;
eq2 = x2^2/a^2 + y2^2/b^2 == 1;
(SubtractSides[eq1, eq2] //
Collect[#, {a, b}] &) /.
(a_^2 - b_^2) :> (a + b) (a - b) /. {a_. b_ + c_. d_ == 0 ->
d/b == -(a/c)}


$$\frac{(\text{y1}-\text{y2}) (\text{y1}+\text{y2})}{(\text{x1}-\text{x2}) (\text{x1}+\text{x2})}=-\frac{b^2}{a^2}$$