Question: How to automatically cancel any common factors on both sides of an equation?

I have encountered the situation frequently where I want to simplify an equation by cancelling out terms on both sides.  I have tried simplify() with a variety of assumptions(J,L>0,etc) and I haven't been able to get it to work.  On a simple equation, one can use 'solve' however there are situations where solve doesn't work and I just want to simplify the equation not solve it.

The script below shows the situation.  I cancel out JL and the complex exponential by manually identifying that they are common factors.  Is there an automatic way of doing this type of simplification?

If I use expand() it clearly shows the common factors on both sides but I haven't found the command that removes any common terms.


 

E2 := (sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(j+1)*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(j-1)*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)-4*(sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*(l+1)*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*(l-1)*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L) = h^2*(sum(sum(`#mover(mi("ρ",fontstyle = "normal"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)

(sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(j+1)*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(j-1)*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)-4*(sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*(l+1)*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*(l-1)*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L) = h^2*(sum(sum(`#mover(mi("ρ",fontstyle = "normal"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)

(1)

E3 := E2*J*L; E4 := simplify(lhs(E3)) = simplify(rhs(E3))

J*L*((sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(j+1)*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(j-1)*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)-4*(sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*(l+1)*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)+(sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*(l-1)*n/L), n = 0 .. L-1), m = 0 .. J-1))/(J*L)) = h^2*(sum(sum(`#mover(mi("ρ",fontstyle = "normal"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*j*m/J)*exp(-(2*I)*Pi*l*n/L), n = 0 .. L-1), m = 0 .. J-1))

 

sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*(m*(j+1)*L+l*n*J)*Pi/(J*L)), n = 0 .. L-1), m = 0 .. J-1)+sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*(m*L*(j-1)+l*n*J)*Pi/(J*L)), n = 0 .. L-1), m = 0 .. J-1)-4*(sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L)), n = 0 .. L-1), m = 0 .. J-1))+sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(n*(l+1)*J+L*j*m)/(J*L)), n = 0 .. L-1), m = 0 .. J-1)+sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(n*(l-1)*J+L*j*m)/(J*L)), n = 0 .. L-1), m = 0 .. J-1) = h^2*(sum(sum(`#mover(mi("ρ",fontstyle = "normal"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L)), n = 0 .. L-1), m = 0 .. J-1))

(2)

 

subsindets(sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*(m*(j+1)*L+l*n*J)*Pi/(J*L)), n = 0 .. L-1), m = 0 .. J-1)+sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*(m*L*(j-1)+l*n*J)*Pi/(J*L)), n = 0 .. L-1), m = 0 .. J-1)-4*(sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L)), n = 0 .. L-1), m = 0 .. J-1))+sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(n*(l+1)*J+L*j*m)/(J*L)), n = 0 .. L-1), m = 0 .. J-1)+sum(sum(`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(n*(l-1)*J+L*j*m)/(J*L)), n = 0 .. L-1), m = 0 .. J-1) = h^2*(sum(sum(`#mover(mi("ρ",fontstyle = "normal"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L)), n = 0 .. L-1), m = 0 .. J-1)), specfunc({Sum, sum}), proc (S) options operator, arrow; op(1, S) end proc)

`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*(m*(j+1)*L+l*n*J)*Pi/(J*L))+`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*(m*L*(j-1)+l*n*J)*Pi/(J*L))-4*`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L))+`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(n*(l+1)*J+L*j*m)/(J*L))+`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(n*(l-1)*J+L*j*m)/(J*L)) = h^2*`#mover(mi("ρ",fontstyle = "normal"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L))

(3)

 

simplify((`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*(m*(j+1)*L+l*n*J)*Pi/(J*L))+`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*(m*L*(j-1)+l*n*J)*Pi/(J*L))-4*`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L))+`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(n*(l+1)*J+L*j*m)/(J*L))+`#mover(mi("u"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(n*(l-1)*J+L*j*m)/(J*L)) = h^2*`#mover(mi("ρ",fontstyle = "normal"),mo("ˆ"))`[m, n]*exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L)))*(1/exp(-(2*I)*Pi*(J*l*n+L*j*m)/(J*L))))

2*`#mover(mi("u"),mo("ˆ"))`[m, n]*(-2+cos(2*Pi*m/J)+cos(2*Pi*n/L)) = h^2*`#mover(mi("ρ",fontstyle = "normal"),mo("ˆ"))`[m, n]

(4)

``


 

Download common_factors.mw

Please Wait...