# How to take the derivative of a function in Im[]?

I tried to take the derivative of a long expression containing $$\text{Re} \text{Li}_3(e^{2\pi ix})$$, the trilogarithm while $$x$$ is real. Since the real part function is linear ,it should be like this $$\frac{\partial }{\partial x}(F(x)+\text{Re}\text{Li}_3(e^{2\pi ix}))=F'(x)-2\pi\text{Im}\text{Li}_3(e^{2\pi ix}))$$ However, MMA's output is something strange like

Derivative[F][x] +
2 I \[Pi] PolyLog[2, E^(2 I \[Pi] x)] Derivative[Im][
PolyLog[3, E^(2 I \[Pi] x)]]


or $$F'(x)+2 i \pi \text{Li}_2\left(e^{2 i \pi x}\right) \text{Re}'\left(\text{Li}_3\left(e^{2 i \pi x}\right)\right)$$ I think the reason is that D didn't treat Re properly.

How can I let MMA know that Re is linear and output the correct result? Thanks in advance.

• Mathematica can't figure what to do with or simplify Re[PolyLog[3, z]] nor with Im[PolyLog[3, z]] so it just returns D[Re[PolyLog]]' and D[Im[....] when you apply the derivative operator on these. What should Re[PolyLog[3, ExpToTrig[E^(2 I Pi x)]] return? btw, try D[Im[Sin[x]], x] and see what you get. Mar 10 at 6:13

We start from the relation $$\Re[g'[x]]=(\Re[g[x]])'$$ for real values of $$x$$. Next, we apply the integral presentation of PolyLog (see Details in the documentation) $$\text{Li}_3(\exp (2 \pi i x))=\int_0^1 \log (t) \log (1-t \exp (2 \pi i x))/t \, dt$$ Now we differentiate under the integral sign, making use of Leibniz integral rule . We deal with an improper integral so we should consider the integral over $$[\epsilon,1]$$ and then we should pass to the limit when $$\epsilon \to 0+$$

  Assuming[x \[Element] Reals, D[Integrate[Log[t]*Log[1 - Exp[2*Pi*I*x]*t]/t, {t, 0, 1}], x]]


2 I \[Pi] PolyLog[2, E^(2 I \[Pi] x)]

  ComplexExpand[Re[%]]


-2 \[Pi] Im[PolyLog[2, E^(2 I \[Pi] x)]]`

The above result is in accordance with numerical calculations , say for $$x=\frac 1 3$$.

Edit.The integral representation $$\text{Li}_3(\exp (2 \pi i x))= \int_0^1 \frac{\log (t) \log (1-t \exp (2 \pi i x))}{t} \, dt$$ instead of $$\text{Li}_3(\exp (2 \pi i x))=-\frac{1}{2} \int_0^1 \log ^2(t) \log (1-t \exp (2 \pi i x)) \, dt$$