# Putting a term under the square root

I want to put a term under the square root (but with Mathematica), such that $$(1+t)^2\sqrt{1+\frac{t^3}{(1+t)^3}}$$
is transformed to
$$\sqrt{(1+t)^4+(1+t)t^3}.$$
I've tried all the forms of Simplify, FullSimplify, Factor, with Assumptions ...

FullSimplify[(1 + t)^2 Sqrt[1 + t^3/(1 + t)^3]]

However, nothing returns the right answer. What can I do?

• Note that the reason Mathematica doesn't do this automatically is because it's not true, in general: Mathematica treats all symbols as implicitly complex unless stated otherwise, and of course, $\sqrt{(1+t)^4} \neq (1+t)^2$ for all complex numbers. Feb 20 at 16:53
• @march, yes I see! But it's strange that simple pointer to Reals or even strictly to $t>0$ doesn't work! Feb 20 at 17:21
• Well, Mathematica also has some algorithm for deciding what it means to be in simplified form. Both the final and initial forms and the pathway between them is part of that algorithm, so it's difficult sometimes to know what it will consider the most simplified form. Feb 20 at 17:24

You can add a transformation on top of the defaults that forces it:

expr = (1 + t)^2 Sqrt[1 + t^3/(1 + t)^3];
assum = FunctionDomain[expr, t]
FullSimplify[expr, assum, TransformationFunctions ->
{Automatic, PiecewiseExpand[BitOr[1, Sign[#]], assum] Sqrt[FullSimplify[# #, assum]] &}]

t < -1 || t ≥ -(1/2)
Sqrt[(1 + t) (1 + 2 t) (1 + t + t^2)]

• But what if t is not Real? Suppose I give assum = FunctionDomain[expr, t, Complexes]? Feb 20 at 14:46
• @codebpr Then the sign adjustment to would become (-1)^Boole[Reduce[Sqrt[(1 + t)^4 (1 + t^3/(1 + t)^3)]/((1 + t)^2 Sqrt[1 + t^3/(1 + t)^3]) == -1, t]] // FullSimplify, so you wouldn't really get a simplification Feb 20 at 15:11
• The code in your comment gives the error The answer found by Reduce contains unsolved equation(s) Feb 20 at 15:18

A simple rule does it

e1 = (1 + t)^2  Sqrt[1 + t^3/(1 + t)^3]
e2 = e1 /. a_.*Sqrt[b_ + c_] :> Sqrt[ a^2*b + a^2*c]

To see conditions when the above is valid, use Reduce (for real t)

Reduce[e1 == e2 && Element[t, Reals]]

The above says for any real t except t=-1 to avoid (1+t) being zero.

• Just an observation. Suppose I take the initial expression as a and the simplified expected expression as b. Then if I use SameQ[a,b], why does Mathematica answer False? Do we need to provide some other $Assumptions apart from t being Real? Feb 20 at 14:09 • @codebpr FYI, I added Reduce result. You see it says for all t, but written in strange way. Feb 20 at 14:19 • Shouldn't the condition be$t \neq -1\$ instead of what Reduce says? Feb 20 at 14:27
• @codebpr Yes, sure., That is what it means, i.e. it is saying (1+t) can not be zero. For any other value it is ok. I do not know why it did not just say that. good point. It is same thing, but computers likes to say things differently. Feb 20 at 14:29