This is a problem I encountered in another (unrelated) question.
I got an expression which is a bit ugly, $2\arctan\frac{5-\sqrt2}{5+\sqrt2}$, but when changing the method I got another prettier expression, $3\arctan\frac{1}{2\sqrt2}$.
Since they are both equal to the same integral, they must be equal as well (and we can easily prove that by doing some simple calculation). But what makes it interesting is, a lot of common mathematics software cannot do this kind of simplification (I tried SageMath and WolframAlpha, they both did nothing).
So let's do it by hand to see what happened.
\begin{align} 2\arctan\frac{5-\sqrt2}{5+\sqrt2} &= \arctan\frac{23}{10\sqrt2}\tag{automatic}\\ &= \arg\left(10\sqrt2+23i\right)\tag{automatic}\\ &= \arg\left(2\sqrt2+i\right)^3\tag{miracle}\\ &= 3\arctan\frac{1}{2\sqrt2}.\tag{automatic} \end{align}
(In the general case, we should also count how many $\pi$ should be added at the end.)
As you can see, the key step here is the factorization $10\sqrt2+23i=\left(2\sqrt2+i\right)^3$. This is a factorization in $\mathbb Z[\sqrt2,i]$, which might be difficult even for computers (I'm not sure).
What's more, normally there's not just $\sqrt2$ that appears, e.g. $$\arctan\frac{\sqrt5-77\sqrt2}{7+11\sqrt{10}}=3\arctan\sqrt5+5\arctan\sqrt2-3\pi.$$
So here is my question:
Is there an algorithmic way to do this kind of simplification?
Let me explain a little where this problem comes from.
I got an integral, for $a>0$:
$$\int_0^\infty e^{-at}\left(\operatorname{erf}\sqrt t\right)^3\,dt=\frac{4}{\pi}\frac1{a\sqrt{a+1}}\arctan\frac{1-b}{1+b},$$
where $b=\frac{a}{a+4}\sqrt{\frac{a+3}{a+1}}$.
I wanted to simplify this expression but failed. The example mentioned before is just the case $a=1$.
I'd be glad if anyone can simplify this expression for any $a>0$, and I'll take it as an acceptable answer since I think this expression is already complicated enough.
I added my answer to the integral problem only.
$$\int_0^\infty e^{-at}\left(\operatorname{erf}\sqrt t\right)^3\,dt=\frac{12}{\pi}\frac1{a\sqrt{a+1}}\left(\arctan\sqrt{\frac{a+3}{a+1}}-\frac\pi4\right).$$
And it didn't give us a general method to deal with all cases.