4
$\begingroup$

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?

$\endgroup$
3
  • $\begingroup$ 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. $\endgroup$
    – march
    Feb 20 at 16:53
  • $\begingroup$ @march, yes I see! But it's strange that simple pointer to Reals or even strictly to $t>0$ doesn't work! $\endgroup$
    – lesobrod
    Feb 20 at 17:21
  • $\begingroup$ 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. $\endgroup$
    – march
    Feb 20 at 17:24

2 Answers 2

4
$\begingroup$

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)]

$\endgroup$
3
  • $\begingroup$ But what if t is not Real? Suppose I give assum = FunctionDomain[expr, t, Complexes]? $\endgroup$
    – codebpr
    Feb 20 at 14:46
  • $\begingroup$ @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 $\endgroup$
    – Coolwater
    Feb 20 at 15:11
  • $\begingroup$ The code in your comment gives the error The answer found by Reduce contains unsolved equation(s) $\endgroup$
    – codebpr
    Feb 20 at 15:18
4
$\begingroup$

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]

Mathematica graphics

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

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

Mathematica graphics

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

$\endgroup$
4
  • $\begingroup$ 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? $\endgroup$
    – codebpr
    Feb 20 at 14:09
  • 1
    $\begingroup$ @codebpr FYI, I added Reduce result. You see it says for all t, but written in strange way. $\endgroup$
    – Nasser
    Feb 20 at 14:19
  • $\begingroup$ Shouldn't the condition be $t \neq -1$ instead of what Reduce says? $\endgroup$
    – codebpr
    Feb 20 at 14:27
  • $\begingroup$ @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. $\endgroup$
    – Nasser
    Feb 20 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.