Expression involving square roots not simplifying
expr = (Sqrt[s γ^3] + 2 Sqrt[s γ^7] + Sqrt[s^5 γ^7] + Sqrt[s γ^11] +
2 s (Sqrt[s γ^5] + Sqrt[s γ^9]))/(γ (1 + s γ + γ^2)^2);
Simplify[PowerExpand[expr]]
More by way of explanation of the "indifference" that causes Simplify
to not budge. In order to factor the expression so that it can be reduced, all the square-roots have to be factored and initially the complexity (computed by Simplify`SimplifyCount
, which is equivalent to LeafCount
on these examples) remains the same:
Simplify`SimplifyCount[Sqrt[s0^5 γ^7]]
Simplify`SimplifyCount[s0^(5/2) γ^(7/2)]
(* 11 11 *)
The actual algorithm used by Simplify
is unknown (to me), but it makes sense to reject a transformation that results in an expression with the same complexity as measured by the ComplexityFunction
(to avoid getting stuck in an infinite cycle of equivalent-complexity expressions).
While there is a simpler solution (see @Nasser's), another approach is to tweak ComplexityFunction
to make the desired steps seem "simpler":
cf = LeafCount[#] + 2 Count[#, Power[_Times, _], {0, ∞}] &;
Simplify[(Sqrt[s0 γ^3] + 2 Sqrt[s0 γ^7] +
Sqrt[s0^5 γ^7] + Sqrt[s0 γ^11] +
2 s0 (Sqrt[s0 γ^5] + Sqrt[s0 γ^9]))/(γ (1 + s0 γ + γ^2)^2),
γ > 0 && s0 > 0, ComplexityFunction -> cf]
(* Sqrt[s0 γ] *)
Raise the coefficient of Count[]
in cf
to 5
and the result will be Sqrt[s0] Sqrt[γ]
.