2
$\begingroup$

I'm very new to Mathematica, and I've been using it to evaluate some symbolic expressions in my research that are too complicated to do by hand. However, some of them don't simplify when it is obvious to me that it could be simplified further. The following is a simple example (compared to the much messier other expressions I have):

FullSimplify[Expand[Sqrt[1+2 Subscript[\[Gamma], Q]+Sqrt[1-4 Subsuperscript[\[Gamma], P, 2]+4 Subscript[\[Gamma], Q]]] Sqrt[(1-2 Subsuperscript[\[Gamma], P, 2]+2 Subscript[\[Gamma], Q]+Sqrt[1-4 Subsuperscript[\[Gamma], P, 2]+4 Subscript[\[Gamma], Q]])/(1+2 Subscript[\[Gamma], Q]+Sqrt[1-4 Subsuperscript[\[Gamma], P, 2]+4 Subscript[\[Gamma], Q]])] (1+4 Subscript[\[Gamma], Q]+Sqrt[1-4 Subsuperscript[\[Gamma], P, 2]+4 Subscript[\[Gamma], Q]])], 0<4 Subsuperscript[\[Gamma], P, 2]+4 Subscript[\[Gamma], Q]<1 \[And]Subscript[\[Gamma], P] \[Element] Reals \[And]Subscript[\[Gamma], Q] \[Element] Reals ]

(I also attached the screenshot for better readability) enter image description here

So clearly the $$\sqrt{1+2\gamma_Q+\sqrt{1-4\gamma_P^2+4\gamma_Q}}$$ term can be cancelled out since I have a constraint that $\gamma_P, \gamma_Q$ are such that this term is strictly positive. I have tried both Simplify, Expand then Simplify, FullSimplify, all with Assumptions option, as well as tighting the constraints on $\gamma_P, \gamma_Q$ so that they are not just real but in a smaller interval, so I'm not sure how to make this expression simplify even further. Any guidance would be appreciated!

$\endgroup$
3
  • 2
    $\begingroup$ PowerExpand instead of Expand would do it. $\endgroup$
    – Syed
    Commented May 27, 2022 at 4:53
  • $\begingroup$ I think I remember reading, but you should check this yourself to make certain that I am correct, that FullSimplify doesn't "denest radicals" and there is a library function somewhere that will enable Mathematica to do that in the cases where it is feasible to do. After that has been done then sometimes it is possible to further simplify some expressions. A Google Search for denest radical gives what looks like it might help. Or other searches might help. If that works for your problem then that may be what you are looking for. $\endgroup$
    – Bill
    Commented May 27, 2022 at 6:26
  • 1
    $\begingroup$ Notice that Superscript[x,2]=== x^2 is False. Do you mean for Subsuperscript[\[Gamma], P, 2] to mean Subscript[\[Gamma],P]^2? In any case, you should avoid using Subscript while defining symbols or variables. Things like Subscript[x, 1] are not a symbol, but a composite expression where Subscript is an operator without built-in meaning. Read how to properly define indexed variables here $\endgroup$
    – rhermans
    Commented May 27, 2022 at 8:41

1 Answer 1

1
$\begingroup$

As @Syed points out:

FullSimplify[PowerExpand[YOUR EXPRESSION], your conditions]

$\left(\sqrt{-4 \gamma _P^2+4 \gamma _Q+1}+4 \gamma _Q+1\right) \sqrt{\sqrt{-4 \gamma _P^2+4 \gamma _Q+1}-2 \gamma _P^2+2 \gamma _Q+1}$

$\endgroup$
5
  • 1
    $\begingroup$ That is not True for some variable combinations. f[x, y] /. {x -> -5, y -> -4} // N yields 29.207 and FullSimplify[PowerExpand[f[x, y]], cond] /. {x -> -5, y -> -4} // N yields -29.207 $\endgroup$
    – Akku14
    Commented May 27, 2022 at 6:45
  • 1
    $\begingroup$ "your" conditions are the conditions the OP gives. $\endgroup$
    – Akku14
    Commented May 27, 2022 at 6:50
  • 1
    $\begingroup$ Then let me ask, why does FullSimplify not recognize this? f[a, b] // PowerExpand[#, Assumptions -> cond] & // FullSimplify[#, Assumptions -> cond] &should cancel the additions term (-1)^Floor[(\[Pi] + Arg[1 + 2 b + Sqrt[1 - 4 a + 4 b]] - Arg[1 - 2 a + 2 b + Sqrt[1 - 4 a + 4 b]])/(2 \[Pi])] $\endgroup$
    – Akku14
    Commented May 27, 2022 at 6:56
  • 1
    $\begingroup$ Ok. Found the error. Didn't notice a typo in OP. Subsuperscript[\[Gamma], P, 2] instead of Subscript[\[Gamma], P] $\endgroup$
    – Akku14
    Commented May 27, 2022 at 7:01
  • 1
    $\begingroup$ Nevertheless in this case not neccesary, but in general PowerExpand with conditions is needed. $\endgroup$
    – Akku14
    Commented May 27, 2022 at 7:21

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.