# Simplification problem for complex expression

I have a complex expression. Where the variable(s) is(are) real. Even after specifying that the variables are real, it doesn't seem to affect the result. Here k is real, but the expression comes like.

H12[k_] = {{-(1/4) Sqrt[-E^(
2 I k)] (4 π - Arg[E^(I k)/Sqrt[-E^(2 I k)]] -
Arg[E^(-I k) Sqrt[-E^(2 I k)]]) Conjugate[Sqrt[-E^(2 I k)]], (
I E^(I k) (Arg[E^(I k)/Sqrt[-E^(2 I k)]] -
Arg[E^(-I k) Sqrt[-E^(2 I k)]]))/(
4 Sqrt[-E^(2 I k)])}, {1/4 I E^(
I k) (Arg[E^(I k)/Sqrt[-E^(2 I k)]] -
Arg[E^(-I k) Sqrt[-E^(2 I k)]]) Conjugate[Sqrt[-E^(2 I k)]],
1/4 (-4 π + Arg[E^(I k)/Sqrt[-E^(2 I k)]] +
Arg[E^(-I k) Sqrt[-E^(2 I k)]])}};
DH12[k_] = FullSimplify[D[H12[k],k];


In the result you get Derivative[Conjugate] and Derivative[Abs]. Eventhough, k is real. Is there a way to get out of it. Later, I need to integrate the expression with some other functions because of this problem ,I am not able to do that. Even if I try integrating it just goes on for running..

Simplify[DH12[k], {k, z} ∈ Reals], {k, -π, π}]


After sometime the result comes out symbolically,
\!$$\*SubsuperscriptBox[\(∫$$, $$-π$$, $$π$$] \*FractionBox[$$1$$, $$4$$]$$\$$\)...

• How did you generate this matrix? It seems to be real but this is not obvious since you have entries like Conjugate[Sqrt[-E^(2 I k)]], which is complex even for real k. – kiara Oct 20 '17 at 12:23
• @Fabian This bit is from a code(working on it). Is there a way to avoid such Derivative[Conjugate] get some answer out of it. – L.K. Oct 20 '17 at 12:25
• I dont know what you mean by Derivative[Conjugate] where do you see this? – kiara Oct 20 '17 at 12:35
• I see this matrix: $$\left( \begin{array}{cc} -\frac{1}{4} i \left(-\arg \left(\frac{e^{i k}}{\sqrt{-e^{2 i k}}}\right)-\arg \left(e^{-i k} \sqrt{-e^{2 i k}}\right)+4 \pi \right) \left(e^{-2 \Im(k)}-e^{2 i k} \text{Conjugate}'\left(\sqrt{-e^{2 i k}}\right)\right) & 0 \\ \frac{e^{i k-2 \Im(k)} \left(\arg \left(\frac{e^{i k}}{\sqrt{-e^{2 i k}}}\right)-\arg \left(e^{-i k} \sqrt{-e^{2 i k}}\right)\right) \left(e^{2 i \Re(k)} \text{Conjugate}'\left(\sqrt{-e^{2 i k}}\right)-1\right)}{4 \sqrt{-e^{2 i k}}} & 0 \\ \end{array} \right)$$ – kiara Oct 20 '17 at 12:36
• @Fabian Conjugate′ is actually Derivative[Conjugate] – L.K. Oct 20 '17 at 12:42

H12[k_] = {{-(1/4) Sqrt[-E^(2 I k)] (4 π - Arg[E^(I k)/Sqrt[-E^(2 I k)]] -
Arg[E^(-I k) Sqrt[-E^(2 I k)]]) Conjugate[
Sqrt[-E^(2 I k)]], (I E^(I k) (Arg[E^(I k)/Sqrt[-E^(2 I k)]] -
Arg[E^(-I k) Sqrt[-E^(2 I k)]]))/(4 Sqrt[-E^(2 I k)])}, {1/
4 I E^(I k) (Arg[E^(I k)/Sqrt[-E^(2 I k)]] -
Arg[E^(-I k) Sqrt[-E^(2 I k)]]) Conjugate[Sqrt[-E^(2 I k)]],
1/4 (-4 π + Arg[E^(I k)/Sqrt[-E^(2 I k)]] +
Arg[E^(-I k) Sqrt[-E^(2 I k)]])}};


Plotting indicates that the terms are real and constant.

Plot[Evaluate@Flatten@H12[k], {k, -Pi, Pi},
PlotStyle -> {{Thick, AbsoluteDashing[{20, 20}]}, {Thick, DotDashed},
AbsoluteDashing[{20, 20}], Dotted},
Frame -> True, Axes -> False,
WorkingPrecision -> 20,
PlotPoints -> 200,
PlotLegends -> Placed[Automatic, {0.75, 0.5}]] The constant values are

SeedRandom;
Table[H12[RandomInteger[{-10, 10}]] // Simplify // ComplexExpand //
Simplify, {20}] // Union

(* {{{-π, -(π/4)}, {-(π/4), -π}}} *)


EDIT: Or using rationalized random reals

SeedRandom;
Table[H12[RandomReal[{-10., 10.}] // Rationalize[#, 0] &] //
Simplify // ComplexExpand // FullSimplify, {20}] // Union

(* {{{-π, -(π/4)}, {-(π/4), -π}}} *)


For general k, looking at the series expansion

Assuming[Element[k, Reals], order = 50;
Map[(Series[#, {k, 0, order}] // Normal) &,
(H12[k] // ComplexExpand[#, TargetFunctions -> {Re, Im}] & //
Simplify), {2}]]

(* {{-π, -(π/4)}, {-(π/4), -π}} *)


The derivatives are zero.

• Impressive. Thanks a lot – L.K. Oct 20 '17 at 17:03

You can simplify the expression as H12[k] is actually constant:

H12[k_]={{-π, -π/4}, {(-π/4), -π}}

So the derivatives should be zero.

• How to get this result? Thanks – L.K. Oct 20 '17 at 13:07
• I just simplified the entries term by term. So e.g. I E^(I k) Conjugate[Sqrt[-E^(2 I k)]] = -1 or "Sqrt[-E^(2 I k)] Conjugate[Sqrt[-E^(2 I k)]] // FullSimplify" which gives E^(-2 Im[k]) so this zero. – kiara Oct 20 '17 at 13:08