0
$\begingroup$

d[i,j] and M[i,j] are elements of size arrays of size 2x2

After some manipulations I get this as Output

  I d[1, 2] d[2, 1] M[1, 2]   I d[1, 1] d[2, 2] M[1, 2]
---------------------------- - ------------------------- + 
      det (Iw + M)                det (Iw + M)

  I d[1, 1] d[2, 2] M[2, 1]   I d[1, 2] d[2, 1] M[2, 1]
  ------------------------- - -------------------------
        det (Iw + M)                det (Iw + M)

So I did Collect[] to collect M[1,2] and M[2,1]

Collect[(I*d[1, 2]*d[2, 1]*M[1, 2])/(det*(Iw + M)) - 
   (I*d[1, 1]*d[2, 2]*M[1, 2])/(det*(Iw + M)) - 
   (I*d[1, 2]*d[2, 1]*M[2, 1])/(det*(Iw + M)) + 
   (I*d[1, 1]*d[2, 2]*M[2, 1])/(det*(Iw + M)), {M[1, 2], M[2, 1]}]

and I get the output as

 I d[1, 2] d[2, 1]   I d[1, 1] d[2, 2]
(----------------- - -----------------) M[1, 2] + 
   det (Iw + M)        det (Iw + M)

     I d[1, 2] d[2, 1]    I d[1, 1] d[2, 2]
  (-(-----------------) + -----------------) M[2, 1]
       det (Iw + M)         det (Iw + M)

Now I want to remove particular common I out of the numerator brackets and also make the terms to add up.

Please let me know how to do

$\endgroup$
  • $\begingroup$ Simplify[Collect[(I*d[1,2]*...]/I] removes all the I from your expression. In other words just divide your expression by I and then Simplify $\endgroup$ – Bill Jul 30 '19 at 15:02
  • $\begingroup$ How do I add up the terms in the brackets ? $\endgroup$ – Chetan Waghela Jul 30 '19 at 15:08
  • $\begingroup$ I do not understand what you mean "add up the terms in brackets". d[1,2] tells Mathematica that d is a function of 2 arguments. Do you want to change d[1, 2] into 3 and d[2,2] into 4? Perhaps edit your post showing what you want the result to be $\endgroup$ – Bill Jul 30 '19 at 15:38
  • 1
    $\begingroup$ @Bill it's pretty clear that OP meant d[[1,2]] $\endgroup$ – lirtosiast Jul 30 '19 at 19:14
  • 1
    $\begingroup$ does Factor@Collect[(I*d[1, 2]*d[2, 1]*M[1, 2])/(det*(Iw + M)) - (I* d[1, 1]*d[2, 2]*M[1, 2])/(det*(Iw + M)) - (I*d[1, 2]*d[2, 1]* M[2, 1])/(det*(Iw + M)) + (I*d[1, 1]*d[2, 2]* M[2, 1])/(det*(Iw + M)), {M[1, 2], M[2, 1]}] give what you need? $\endgroup$ – kglr Jul 30 '19 at 22:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.