Algebraic manipulation on removing common factor outside

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

• 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 – Bill Jul 30 '19 at 15:02
• How do I add up the terms in the brackets ? – Chetan Waghela Jul 30 '19 at 15:08
• 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 – Bill Jul 30 '19 at 15:38
• @Bill it's pretty clear that OP meant d[[1,2]] – lirtosiast Jul 30 '19 at 19:14
• 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? – kglr Jul 30 '19 at 22:42