Group Abstract Group Abstract

Message Boards Message Boards

0
|
53 Views
|
5 Replies
|
4 Total Likes
View groups...
Share
Share this post:

How does one transform this rational expression into this specific equivalent form?

Posted 3 days ago
(8 + 4 x1 + 2 x2 + x1 x2)/(-8 - 2 x1 + 4 x2 + x1 x2)

How to transform the fraction above into each of these three equivalent forms?

1:

(8 + 4 (x1 + x2) - 2 x2 + x1 x2)/(-8 - 2 (x1 + x2) + 6 x2 + x1 x2)

2:

(8 + 2 (x1 + x2) + 2 x1 + x1 x2)/(-8 - 2 (x1 + x2) + 6 x2 + x1 x2)

3:

(8 + 2 (x1 + x2) + 2 x1 + x1 x2)/(-8 + 4 (x1 + x2) - 6 x1 + x1 x2)

The rule for algebraic manipulation is to rewrite x₁ or x₂ in the numerator and denominator as coefficient multiples of (x₁ + x₂), using addition and subtraction identities based on their fixed coefficients, while keeping all other terms unchanged.

POSTED BY: Bill Blair
5 Replies

Another way is to write the general form of the desired expression and to solve the equation. Here it is for number 1:

expr = (8 + 4 x1 + 2 x2 + x1 x2)/(-8 - 2 x1 + 4 x2 + x1 x2);
general = (8 + a (x1 + x2) + b x1 + c x2 + x1 x2)/(-8 + d (x1 + x2) + 
     e x1 + f x2 + x1 x2);
Solve[ForAll[{x1, x2}, Numerator[Together[general - expr]] == 0] && 
  b == 0 && e == 0]
general /. %[[1]]
POSTED BY: Gianluca Gorni
Posted 3 hours ago

Thank you very much for this elegant approach using Solve with ForAll to match coefficients! Your method is very clear and directly gives the parameters for the first equivalent form. It’s a great way to formalize the transformation rule I described. I really appreciate your help!

POSTED BY: Bill Blair

You need an algebraic CRISPR for your work. :)

A general strategy is to replace the expression you want to collect with a dummy variable, collect the dummy variable, and reverse the replacement. A complicating issue here is to deal only with the linear part of the polynomial numerator and denominator. On the one hand, Collect[] won't be needed since Plus[] will handle it automatically; on the other hand, one has to take care not to make replacements in the nonlinear terms. There are four combinations, of which only three are sought. I show all four anyway:

expr = (8 + 4 x1 + 2 x2 + x1 x2)/(-8 - 2 x1 + 4 x2 + x1 x2);

vars = {x1, x2};
Clear[t]; (* dummy variable *)
Join[
   {{"num replacement", "den replacement", "result"}},
   Flatten[
    Table[
     {num -> t - First@DeleteCases[vars, num],
      den -> t - First@DeleteCases[vars, num],
      (** main algorithm **)
      Divide @@ MapThread[
        Replace[Expand@#1,
           c_. #2 /; NumericQ[c] ->
            c*t - c*First@DeleteCases[vars, #2],
           1] /. t -> Total[vars] &,
        {NumeratorDenominator[Together@expr], {num, den}}

        ]},
     {num, vars}, {den, vars}],
    1]
   ] // Grid // TeXForm

$$ \begin{array}{ccc} \text{num replacement} & \text{den replacement} & \text{result} \ \text{x1}\to t-\text{x2} & \text{x1}\to t-\text{x2} & \frac{\text{x1} \text{x2}+4 (\text{x1}+\text{x2})-2 \text{x2}+8}{\text{x1} \text{x2}-2 (\text{x1}+\text{x2})+6 \text{x2}-8} \ \text{x1}\to t-\text{x2} & \text{x2}\to t-\text{x2} & \frac{\text{x1} \text{x2}+4 (\text{x1}+\text{x2})-2 \text{x2}+8}{\text{x1} \text{x2}+4 (\text{x1}+\text{x2})-6 \text{x1}-8} \ \text{x2}\to t-\text{x1} & \text{x1}\to t-\text{x1} & \frac{\text{x1} \text{x2}+2 (\text{x1}+\text{x2})+2 \text{x1}+8}{\text{x1} \text{x2}-2 (\text{x1}+\text{x2})+6 \text{x2}-8} \ \text{x2}\to t-\text{x1} & \text{x2}\to t-\text{x1} & \frac{\text{x1} \text{x2}+2 (\text{x1}+\text{x2})+2 \text{x1}+8}{\text{x1} \text{x2}+4 (\text{x1}+\text{x2})-6 \text{x1}-8} \ \end{array} $$

Note: Together@expr could be just expr, if it can be assumed that expr is already "together" in a single, simple fraction; likewise Expand[] is not needed in this case because the numerator and denominator of expr are already expanded. But if one uses Together@expr, then one needs to Expand[] the denominator since it may be factored by Together[].

[Note: I don't know if other people see this problem, but in edit mode, the TeX table above is displayed properly. Out of edit mode (the normal browsing mode), the TeX table appears as a single line.]

POSTED BY: Michael Rogers
Posted 3 hours ago

Thanks a lot for this clever dummy-variable / replacement strategy! Your algorithm with Table and MapThread systematically generates all four combinations, which perfectly explains where the three equivalent forms come from. The TeX table you provided makes the results very easy to follow. This is exactly the algebraic “CRISPR” I needed for this problem. Great solution!

POSTED BY: Bill Blair
Posted 3 hours ago

Thanks a lot for this clever dummy-variable / replacement strategy! Your algorithm with Table and MapThread systematically generates all four combinations, which perfectly explains where the three equivalent forms come from. The TeX table you provided makes the results very easy to follow. This is exactly the algebraic “CRISPR” I needed for this problem. Great solution!

POSTED BY: Bill Blair
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard