# How does WolframAlpha simplify this trig expression?

I am trying to understand how WolframAlpha reduces the following trig expression $$\frac{\ln \left(\sin \left(\frac{\alpha x}{2}\right)+\cos \left(\frac{\alpha x}{2}\right)\right)}{\alpha }-\frac{\ln \left(\cos \left(\frac{\alpha x}{2}\right)-\sin \left(\frac{\alpha x}{2}\right)\right)}{\alpha }$$ into $$\frac{\ln (\tan (\alpha x)+\sec (\alpha x))}{\alpha }$$

I tried using TrigExpand, TrigReduce and FullSimplify with no use.

CODE:

FullSimplify[Integrate[Sec[\[Alpha]*x], x], Assumptions -> {\[Alpha] > 0 && Element[x, Reals]}]

• Did you try Assumptions->[Alpha]>0&& x [Element] Reals? Jan 19, 2018 at 18:23
• @user64494 yes I’ll post the code. It doesn’t work Jan 19, 2018 at 18:27
• The command with the option Assumptions -> [Alpha] > 0 && x >= 0 && x <= Pi/(4*[Alpha]) performs (2 ArcTanh[Tan[(x [Alpha])/2]])/[Alpha]. Jan 19, 2018 at 18:36
• This will get you part way there Simplify[Log[Sin[a x/2]+Cos[a x/2]]/a-Log[Cos[a x/2]-Sin[a x/2]]/a, Sin[a x/2]+Cos[a x/2]>0 && Cos[a x/2]-Sin[a x/2]>0]To finish you probably need to think more about zeros in denominators
– Bill
Jan 19, 2018 at 18:39
• Note that Integrate[Sec[α x], x] /. {x -> 1, α -> 3.} is different from Log[Tan[α x] + Sec[α x]]/α /. {x -> 1, α -> 3.}, so the functions are not the same. If that's not important, maybe FullSimplify[Integrate[Sec[α x], x], TransformationFunctions -> {Automatic, Log@*Exp}] suffice? Jan 19, 2018 at 20:25

ClearAll[x,a,A0,B0];

$$\frac{\log \left(\frac{\sin \left(\frac{a x}{2}\right)+\cos \left(\frac{a x}{2}\right)}{\cos \left(\frac{a x}{2}\right)-\sin \left(\frac{a x}{2}\right)}\right)}{a}$$