3
$\begingroup$

such as 1:

eq1=x+y==3
eq2=x+2y==7

get the result:

(x+y)/(x+2y)==3/7

such as 2:

eq3=x^2-y^2==9
eq4=x-y==3

get the result:

x+y==3

such as 3:

The parameters a and c are both greater than 0

eq5=((x+c)^2+y^2)-((x-c)^2+y^2)==4 c x
eq6=Sqrt[(x+c)^2+y^2]+Sqrt[(x-c)^2+y^2]==2a

get the result:

Sqrt[(x+c)^2+y^2]-Sqrt[(x-c)^2+y^2]==2 c x/a

to David

The second and the third scenario did not achieve the desired result

enter image description here

eq3 = x^2 - y^2 == 9
eq4 = x - y == 3
DivideSides[eq3, eq4, Assumptions -> {x - y != 0}]
eq5 = ((x + c)^2 + y^2) - ((x - c)^2 + y^2) == 4 c x
eq6 = Sqrt[(x + c)^2 + y^2] + Sqrt[(x - c)^2 + y^2] == 2 a
DivideSides[eq5, eq6, Assumptions -> {a > 0, c > 0}]

Adding it doesn't work either

$\endgroup$
2
  • $\begingroup$ DivideSides accepts Assumptions option, please read the document carefully. And please put a bit more effort in adding proper tags to your question. $\endgroup$
    – xzczd
    Commented Apr 18, 2023 at 3:28
  • $\begingroup$ Just similar to using Expand in your previous question, Simplify/FullSimplify. $\endgroup$
    – xzczd
    Commented Apr 18, 2023 at 4:15

3 Answers 3

2
$\begingroup$
Clear["Global`*"]

div[eq1_, eq2_] := Equal @@ Divide @@ List @@@ {eq1, eq2}

eq1 = x + y == 3;
eq2 = x + 2 y == 7;

div[eq1, eq2]

(* (x + y)/(x + 2 y) == 3/7 *)

eq3 = x^2 - y^2 == 9;
eq4 = x - y == 3;

Simplify@div[eq3, eq4]

(* x + y == 3 *)

eq5 = ((x + c)^2 + y^2) - ((x - c)^2 + y^2) == 4 c x;
eq6 = Sqrt[(x + c)^2 + y^2] + Sqrt[(x - c)^2 + y^2] == 2 a;

Assuming[a > 0 && c > 0, FullSimplify@div[eq5, eq6]]

(* Sqrt[(c + x)^2 + y^2] == (2 c x)/a + Sqrt[(c - x)^2 + y^2] *)
$\endgroup$
5
$\begingroup$

As with MultiplySides:

DivideSides[eq1, eq2]
$\endgroup$
1
$\begingroup$

Just for fun:

Thread[Unevaluated@Divide[##], Equal] &[eq1, eq2]

Thread[Unevaluated@Divide[##], Equal] &[eq3, eq4] // Map@Simplify

Thread[Unevaluated@Divide[##], Equal] &[eq5, eq6] // Map@FullSimplify
$\endgroup$
2
  • $\begingroup$ Can you generalize this method to two equations adding, subtracting, and multiplying simultaneously? thank you! $\endgroup$
    – csn899
    Commented Apr 19, 2023 at 7:16
  • $\begingroup$ @csn899 I don't think you are ready for evaluation control. Take a look at ApplySides. When reading the document you should always check those in See also section at the end of document page. $\endgroup$
    – xzczd
    Commented Apr 19, 2023 at 8:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.