I am using Mathematica to check some long, tedious calculations and I am stumped by some mysterious behavior. If I simplify a long expression that clearly has square real factors under a radical, for some reason Simplify
and FullSimplify
will not extract them even if I declare them as being real. Here is the behavior I expect, and I see it in this simple case:
In[1]:= FullSimplify[Sqrt[b^2], b \[Element] Reals]
Out[1]= Abs[b]
This is fine, but when I try something just slightly more complex it fails entirely:
In[2]:= FullSimplify[Sqrt[b^2 + b^4], b \[Element] Reals]
Out[2]= Sqrt[b^2 + b^4]
It seems clear that the result should be Abs[b]*Sqrt[1+b^2]
. I have tried adding //PowerExpand
as well as Assuming[b \[Element] Reals, FullSimplify[Sqrt[b^2 + b^4]]]
and neither gives the expected result.
Assuming[Element[b, Reals], Simplify /@ ((Sqrt[b^2 + b^4] // Factor) /. Sqrt[x_ y_] :> Sqrt[x] Sqrt[y])]
$\endgroup$