# Convert an expression to use a specific analytic form

I have an expression that evaluates to an expression containing multiple ExpIntegralEi expressions. However, I would prefer that Mathematica use ExpIntegralE instead. Is this possible somehow?

(Usually $\operatorname{Ei}(-x) = -E_1(x)$. However, just switching the signs does not work -- I think this relationship is not generally valid for arbitrary complex arguments).

• Apart, perhaps, from branch cuts, it should work, according to Wolfram MathWorld. Commented Dec 8, 2015 at 23:45

The two functions can be related with the appropriate choice of analytical extension at the branch cut. Replace

ExpIntegralEi[x + I y]


by

-ExpIntegralE[1, -x - I y] + Piecewise[{{-I Pi, y < 0}, {I Pi, y > 0}}]


A numerical comparison of the two shows that they are equal.

Plot3D[Evaluate[ReIm[ExpIntegralEi[x + I y]]], {x, -2, 2}, {y, -2, 2},
AxesLabel -> {x, y, Ei}]


Plot3D[Evaluate[ReIm[-ExpIntegralE[1, -x - I y] +
Piecewise[{{-I Pi, y < 0}, {I Pi, y > 0}}]]], {x, -2, 2}, {y, -2, 2},
AxesLabel -> {x, y, E1}]