I have this expression: $expr = \frac{2 A B}{A m + m} + C^2 + D^2$
and I want to get: $expr = \frac{2 B}{m \left( 1 + \frac{1}{A} \right)} + C^2 + D^2$
I am trying to use expr.args to get the term that interests me, but I fail to get out the A and the m in the denominator. I have the impression to be stock on a vicious circle. In the documentation, I see that expr.func() could be a way to do it. But it evades me.
Any suggestions? Thank you in advance How should I write latex expression?