2
$\begingroup$

I have a list of equations:

eqns={a/b==c,d/e==f,...,x/y==z}

Now I want to muliply each of the equations with corresponding denominator, so that the result is:

eqns={a==c*b,d==f*e,...,x==z*y}

Is there a way to achieve that, or do I have to loop through the list?

$\endgroup$
1
  • $\begingroup$ Manipulate is a Mathemaqtica function unrelated to your task. I recommend you change your title. $\endgroup$ Nov 30, 2023 at 18:09

3 Answers 3

5
$\begingroup$
MultiplySides[#,Denominator[First@#],Assumptions->Denominator[First@#]>0]&/@eqns

(*{a ==b c, d == e f, x == y z} *)
$\endgroup$
3
$\begingroup$

One of the ways is as follows.

eqns = {a/b == c, d/e == f, x/y == z}; Map[#[[1]]/#[[1, 2]] == #[[2]]/#[[1, 2]] &, eqns]

{a == b c, d == e f, x == y z}

$\endgroup$
1
$\begingroup$
eqns = {a/b == c, d/e == f, x/y == z};
eqns /. u_/v_ == w_ -> u == w*v

(*  {a == b c, d == e f, x == y z}  *)

Have fun!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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