Skip to main content
3 of 3
deleted 8 characters in body
Daniel Mahler
  • 1.1k
  • 8
  • 16

Guiding Mathematica to perform specific simplifications

I would like Mathematica to cancel out a specific term as much as possible. One of my computations simplify to

((Pi*((l^2 + m^2 + 1)
      * ((l^2 + m^2 + 1) * Derivative[0, 1][w][l, m]^2 
         + Derivative[1, 0][w][l, m] * ((l^2 + m^2 + 1) * Derivative[1, 0][w][l, m] - 4*m)
         + 4*l*Derivative[0, 1][w][l, m])
      + 4*(l^2 + m^2)))
  / (l^2 + m^2 + 1))

I would like it to eliminate the l^2 + m^2 + 1 term as much as possible. Distrubute goes part of the way:

 (4 * (l^2 + m^2) * Pi / (1 + l^2 + m^2)^2 
  + ((Pi*(4*l*Derivative[0, 1][w][l, m]
          + (1 + l^2 + m^2) * Derivative[0, 1][w][l, m]^2
          + Derivative[1, 0][w][l, m]
            *(-4*m + (1 + l^2 + m^2)*Derivative[1, 0][w][l, m])))
     / (1 + l^2 + m^2)))

Now I would like to cancel out the two occurences in the numerateor of the second term. I have tried various combinations of Cancel, Apart, Expand, Factor and Simplify, but none of those went in the right direction.

Daniel Mahler
  • 1.1k
  • 8
  • 16