# How to express an expression with only ArcTan and ArcTanh?

I have an expression which is simply

(j/k) x^(j/k) LerchPhi[x,1,j/k)]


where 0 < j < k.

Manually I have been able (tedious work) to obtain only ArcTan's and ArcTanh's. How could I ask Mathematica to do this automatically in the most compact form ?

• Clarify your question. What exactly do you intend to do with that expression? Simplify or what? Oct 26, 2013 at 9:00
• @RunnyKine, I think the OP is looking for a generalisation of this. Oct 26, 2013 at 9:05
• @SimonWoods. Ah I see. Oct 26, 2013 at 9:12
• @RunnyKine. It is a kind of simplification. I have been able to do this by hand and arrived to quite nice linear combinations of ArcTan's and ArcTanh's. What I would like to learn is how to formulate the problem and get the most compact form of the result (ideally, one ArcTan and one ArcTanh, but linear combinations will be good). I am not very good (this is an understatement). Oct 26, 2013 at 9:18

This should get you started. For some reason Mathematica returns LerchPhi[x, 1, j/k] unevaluated if the third argument is a symbol. So let's assume $j = 1$ and $k = 4$ (it does meet your requirement $0 < j < k$ ).

Let's first define some complexity function:

cf[k_][e_] :=  k Count[e, _Log | _ArcCot | _ArcCoth, Infinity] + LeafCount[e]


Now we simplify:

FullSimplify[ FunctionExpand[(1/4) x^(1/4) LerchPhi[x, 1, 1/4]],
ComplexityFunction -> cf[#]] & /@ Range

{1/2 (ArcTan[x^(1/4)] + ArcTanh[x^(1/4)]), 1/2 (ArcTan[x^(1/4)] + ArcTanh[x^(1/4)]),
1/2 (ArcTan[x^(1/4)] + ArcTanh[x^(1/4)]),   1/2 (ArcTan[x^(1/4)] + ArcTanh[x^(1/4)])}


Looks like it converged fast to a nicely simplified expression in terms of only ArcTan and ArcTanh

1/2 (ArcTan[x^(1/4)] + ArcTanh[x^(1/4)])


Admittedly, for this lone case, FunctionExpand will do just fine, but if you're trying to generalize this, you'll need to use the ComplexityFunction. To see this try:

FunctionExpand[(1/8) x^(1/8) LerchPhi[x, 1, 1/8]]


You'll get your answer in terms of Log only

x^(1/8) ( -(Log[1 - x^(1/8)]/(8 x^(1/8)))
+ (I Log[1 - I x^(1/8)])/(8 x^(1/8))
- (I Log[1 + I x^(1/8)])/(8 x^(1/8))
+ Log[1 + x^(1/8)]/(8 x^(1/8))
- ((-1)^(1/4) Log[1 - E^(-((I π)/4)) x^(1/8)])/(8 x^(1/8))
+ ((-1)^(3/4) Log[1 - E^((I π)/4) x^(1/8)])/(8 x^(1/8))
- ((-1)^(3/4) Log[1 - E^(-((3 I π)/4)) x^(1/8)])/(8 x^(1/8))
+ ((-1)^(1/4) Log[1 - E^((3 I π)/4) x^(1/8)])/(8 x^(1/8)))


But if we apply our cf:

FullSimplify[FunctionExpand[(1/8) x^(1/8) LerchPhi[x, 1, 1/8]], ComplexityFunction -> cf]


We obtain:

1/4 (ArcTan[x^(1/8)] + ArcTanh[x^(1/8)] - (-1)^( 3/4) (ArcTan[(-1)^(1/4) x^(1/8)]
+ ArcTanh[(-1)^(1/4) x^(1/8)]))


Again, in terms of only ArcTan and ArcTanh.

• This looks as magics ! It is almost what I am looking for.If I may ask : is it feasible to remove the roots of (-1) and use automatically the multiple angles formulas for ArcTan and ArcTanh ? This is what I made by hand. Thanks for you help to the old idiot. Oct 26, 2013 at 11:48
• It does not seem to like (1/3) Oct 26, 2013 at 11:55
• @ClaudeLeibovici. Hmmm, interesting. I wonder why. Looking into it. Oct 26, 2013 at 12:02
• I do not know how to post a Word document to show you my formulas (if you are interested). In any manner, many thanks for your help from the old idiot ! Oct 26, 2013 at 13:41
• @ClaudeLeibovici. I'm glad I could help. If you have a cloud storage you could upload it there and put a link to it here. Oct 26, 2013 at 13:49