# Force an Im-Re separation in a complex number with parameter

I was doing a computation with Mathematica (summing a series) and a part of the result was the following:

$$\frac{\Gamma \left(\frac{1}{4}\right)}{3 \sqrt{2} \sqrt{-\frac{\sqrt{r^3}}{2}-\frac{1}{2} i \sqrt{3} \sqrt{r^3}+1}}$$

I would like to take the denominator, and (considering that $r$ is POSITIVE, that is $r > 0$) I would like to separate the denominator into an Imaginary and a Real part, in such a way that I can then take the complex conjugate and rewrite that fraction as $A + iB$.

The problem is that the commands I tried, do not work... Is there a way to force that separation, considering that $r > 0$ always?

I tried with

ExpToTrig[
Simplify[ComplexExpand[...], Assumptions -> {r > 0}]]


where the dots stands for the expression above. I also tried only with the denominator and it does not work.

Any smarter / stronger command?

Thank you so much!!

• Use ComplexExpand[Re[expr]] to get the real part (assuming all variables are real). Similar for the imaginary part. Then Simplify[..., r > 0]. The results might contain I. That does not mean that their values are not real. – Szabolcs Oct 6 '17 at 12:42
• This really should have the input expression in cut-and-pastable code. – Daniel Lichtblau Oct 6 '17 at 15:03

I found this way to proceed:

Simplify[ComplexExpand[
3 Sqrt (1 - 1/2 (r^3)^(1/3) - 1/2 I Sqrt (r^3)^(1/3))^(1/4),
TargetFunctions -> {Re, Im}], r > 0]


With the following output

$$3 \sqrt{2} \sqrt{r^2-r+1} \left(\cos \left(\frac{1}{4} \tan ^{-1}\left(2-r,-\sqrt{3} r\right)\right)+i \sin \left(\frac{1}{4} \tan ^{-1}\left(2-r,-\sqrt{3} r\right)\right)\right)$$

Could this be ok?

expr = 3 Sqrt (1 - 1/2 (r^3)^(1/3) - 1/2 I Sqrt (r^3)^(1/3))^(1/4);


Note that with the assumption that r > 0 then this expression can be expressed more compactly as

expr2 = Assuming[r > 0, expr // Simplify]

(* 3 (4 + (-2 - 2 I Sqrt) r)^(1/4) *)


Your approach provides the same result with this form

expr3 = Assuming[r > 0,
expr2 // ComplexExpand[#, TargetFunctions -> {Re, Im}] & // Simplify]

(* 3 Sqrt (1 - r + r^2)^(
1/8) (Cos[1/4 ArcTan[2 - r, -Sqrt r]] +
I Sin[1/4 ArcTan[2 - r, -Sqrt r]]) *)


To get the form A + B I, you must Expand this expression

expr4 = expr3 // Expand

(* 3 Sqrt (1 - r + r^2)^(1/8) Cos[1/4 ArcTan[2 - r, -Sqrt r]] +
3 I Sqrt (1 - r + r^2)^(1/8) Sin[1/4 ArcTan[2 - r, -Sqrt r]] *)


Verifying that this is separated into the real and imaginary parts of the original expression:

Assuming[r > 0, (expr4 // First) == Re[expr] // ComplexExpand // FullSimplify]

(* True *)

Assuming[r > 0, (expr4 // Last)/I == Im[expr] // ComplexExpand //
FullSimplify]

(* True *)