1
$\begingroup$

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.

$\endgroup$

1 Answer 1

2
$\begingroup$

Here is a way to do it, starting with the last expression in your question:

Collect[
   (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))), 
 1 + l^2 + m^2]

$$\frac{4 \pi l w^{(0,1)}(l,m)-4 \pi m w^{(1,0)}(l,m)}{l^2+m^2+1}+\pi w^{(0,1)}(l,m)^2+\pi w^{(1,0)}(l,m)^2+\frac{4 \pi \left(l^2+m^2\right)}{\left(l^2+m^2+1\right)^2}$$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.