I am having some trouble getting Mathematica to simplify an expression of the form Sqrt[x]*Sqrt[1/x]
, where x>0
. The problem is that x is assigned to some complicated form by the time Mathematica encounters it, and it fails to recognize that it will simplify. While debugging this problem, I wrote the following code that fails to simplify only when x gets sufficiently complicated. The cases involving x0,x1,x2,x3
will all simplify, but the x4
case will not. What's going on here?
x0 = a;
x1 = a + b;
x2 = a + b*c;
x3 = a + b*c*d;
x4 = a + b*c*d*e;
Simplify[1 == Sqrt[a] Sqrt[1/a], x0 > 0]
Simplify[1 == Sqrt[a + b] Sqrt[1/(a + b)], x1 > 0]
Simplify[1 == Sqrt[a + b*c] Sqrt[1/(a + b*c)], x2 > 0]
Simplify[1 == Sqrt[a + b*c*d] Sqrt[1/(a + b*c*d)], x3 > 0]
Simplify[1 == Sqrt[a + b*c*d*e] Sqrt[1/(a + b*c*d*e)], x4 > 0]
Answer
Probably some internal weirdness with the ComplexityFunction, but:
Simplify[Sqrt[1/(a + b c d e )] Sqrt[a + b c d e ]==1] // PowerExpand
Simplify[1 == Sqrt[a + b*c*d*e] Sqrt[1/(a + b*c*d*e)], x4 > 0] // PowerExpand
(*
True
True
*)
Comments
Post a Comment