# Powerful inverse trigonometric functions simplify

I was calculating the volume of Reuleaux Cube , something like Reuleaux Tetrahedron. 1/24 (-24+24 Sqrt-36 ArcCos[(2 Sqrt)/3]+54 ArcCot[Sqrt]-13 ArcSin[Sqrt[2/3]]+13 ArcSin[1/Sqrt]+5 ArcTan[1/Sqrt]-108 ArcTan[5/Sqrt]-39 ArcTan[Sqrt]-20 ArcTan[3-2 Sqrt]+108 ArcTan[3+2 Sqrt])


It was really complicated.

I know the answer can be written as $\sqrt{2}-1 + \frac{97 \pi }{12}-27 \arctan\left(\sqrt{2}\right)$ or $\sqrt{2}-1+\frac{4 \pi }{3}-\frac{9}{2}\arcsin \left(\frac{23}{27}\right)$.

I tried this way to simplify it:

ArcTogether[expr_] := FullSimplify[
expr //. k_ (f : (ArcSin | ArcCos | ArcTan | ArcCot))[x_] :>
ArcTan[TrigExpand@Tan[k f[x]]] + k f[x] - ArcTan[Tan[k f[x]]]]
ArcExpand[expr_] := First@SortBy[expr /. a : ArcTan[x_] :> Table[
k ArcTan[z] /. First@Solve[{TrigExpand[Tan /@ (a == k ArcTan[z])],
a == k ArcTan[z]}, z, Reals], {k, 2, 20, 1}], LeafCount]


Then I use ArcExpand@ArcTogether[Last@ans] // FullSimplify and got:

$$V=\sqrt{2}-1-\frac{\pi }{6}+\frac{3}{2} \arctan\left(\frac{1633}{13870 \sqrt{2}}\right)$$

This still a bit complex. I need some more powerful way to simplify.

This code $8X$ faster than the original one:

reg=Reduce[{(x+1/2)^2+(y+1/2)^2+(z+1/2)^2<1,x>0,y>0,z>0}]
int=Sequence@@(reg/.{And->List,Inequality[a_,Less,x_,Less,b_]:>{x,a,b}});
AbsoluteTiming[8 Integrate[1,int]]//FullSimplify

• That's an octahedron you have there, not a cube. – J. M.'s torpor Nov 2 '17 at 15:28
• What mathematical argument do you have to believe a better simplification can be made? – m_goldberg Nov 2 '17 at 20:42
• What is your measure of simplicity? – bbgodfrey Nov 3 '17 at 1:27

expr = 1/24 (-24+24 Sqrt-36 ArcCos[(2 Sqrt)/3]+54 ArcCot[Sqrt]-13 ArcSin[Sqrt[2/3]]+13 ArcSin[1/Sqrt]+5 ArcTan[1/Sqrt]-108 ArcTan[5/Sqrt]-39 ArcTan[Sqrt]-20 ArcTan[3-2 Sqrt]+108 ArcTan[3+2 Sqrt]);

rule1 = k_ (f : (ArcSin | ArcCos | ArcTan | ArcCot))[x_] :>
ArcSin[TrigExpand@Sin[k f[x]]] + k f[x] - ArcSin[Sin[k f[x]]];

rule2 = a : (ArcSin[x_]) :>
First@SortBy[
Cases[Flatten@
Table[(# /.
Solve[{TrigExpand[Sin /@ (a == #)], a == #}, z,
Reals]) & /@ {k ArcSin[z], Pi - k ArcSin[z]}, {k, 2,
10}], _?NumericQ], StringLength@ToString@# + LeafCount@# &];

expr //. rule1 // FullSimplify
% /. rule2
% /. rule2
% /. rule2
% // Simplify


-1 + Sqrt - Pi/8 + 1/24 (-Pi + 9 ArcSin[(34616649035551240 Sqrt)/150094635296999121])

-1 + Sqrt - Pi/8 + 1/24 (-Pi + 36 ArcSin[1633/19683])

-1 + Sqrt - Pi/8 + 1/24 (-Pi + 36 (Pi - 9 ArcSin[1/3]))

-1 + Sqrt + (4 Pi)/3 - 27/2 ArcSin[1/3]