TL;DR: I've made something work (again) but in the process I used something which makes no sense - I wonder why it all works in the end. Please explain it to me or disprove my findings.
Let's define an operator $\circledast$ in this way: $x \circledast y = \frac{x+y}{1+xy}$
I want to find $$((2\circledast3)\circledast4)\circledast\cdots\circledast n, \;n \ge 3$$
My Approach
First thing to notice is that: $(x \circledast y) \circledast z = x \circledast (y \circledast z)$ so it doesn't make any difference which order are we applying it and so we can remove all the parenthesis and read it as say "left to right".
Now remembering that $\tanh(x+y)=\frac{\tanh x+\tanh y}{1+\tanh x\cdot \tanh y}$ we can see that $\tanh(\tanh^{-1}x+\tanh^{-1}y)=\frac{x+y}{1+xy} = x \circledast y$. Therefore we can rewrite the expression we want as $S = \tanh(\tanh^{-1}2+\tanh^{-1}3+...+\tanh^{-1}n)$, so $$\tanh^{-1}S = \sum_{k=2}^n\tanh^{-1}k$$
"So far so good" - I would've said, but the issue is that inverse hyperbolic tangent has only domain $(-1, 1)$ over reals. But - let's roll with it, the "why it works" is part of the question.
From here we use the logarithmic form: $\tanh^{-1}x=\frac{1}{2}\ln\frac{1+x}{1-x}$ - again, ignoring the glaring issues with the domain. We get: $$\frac{1}{2}\ln\left(\frac{1+S}{1-S}\right) = \frac{1}{2}\sum_{k=2}^n\ln\left(\frac{1+k}{1-k}\right)=\frac{1}{2}\ln\left(\prod_{k=2}^n\frac{1+k}{1-k}\right)$$
Here's another "red flag" - using the logarithm property of sum to product on something that potentially doesn't exist - or even if it does, it is complex, and if I understand correctly, complex version of $\ln$ is $\mathrm{Log}$ which is multivalued so it's not right to claim $\ln(ab)=\ln(a)+\ln(b)$ .
Finally, we notice that if we flip the sign of the denominator we will end up with a telescoping product on the fraction shifted by 2 on the numerator to the right. Hence we end up with this: $$\frac{1}{2}\ln\left(\frac{1+S}{1-S}\right) = \frac{1}{2}\ln\left(\prod_{k=2}^n\frac{1+k}{1-k}\right) = \frac{1}{2}\ln\left((-1)^{n-1}\frac{n(n+1)}{2}\right)$$
We have $(-1)^{n-1}$ because there will be in total $n-1$ members (we start at $2$ and end at $n$). And now.. you guessed it. We got $\frac{1}{2}$ on both sides, we got $\ln$ on both sides - let's "cancel" them (another "red flag" here). If we do so we end up with $\frac{1+S}{1-S}=(-1)^{n-1}\frac{n(n+1)}{2}$ thus $$S=\frac{(-1)^{n-1}(n^2+n)-2}{(-1)^{n-1}(n^2+n)+2}$$
which is not only well-defined, but also is a correct expression for $S$ (it works for any $n$)
Question is - why does this work despite operating on things which are not well-defined? Or am I wrong and the $\tanh^{-1}x$ is well-defined outside of $(-1,1)$? (as well as $\ln$ and its properties over complex numbers)?
EDIT:
There's a proposed fix to the solution, courtesy of @Tortar
. He has a great observation that $x \circledast y = \frac{1}{x} \circledast \frac{1}{y}$ and therefore we can avoid problematic domain issues if we rewrite $S = \frac{1}{2} \circledast \frac{1}{3} \circledast ... \circledast \frac{1}{n}$ . This, however, still has issues
- First, it doesn't explain why the original "solution" works. It all makes sense if I would apply this transformation before using $\tanh^{-1}$ but I do not, hence the question still stands
- More importantly - and this is why I decided to add this to the body of the question itself - this will lead to an incorrect result. That is because on the logarithms step we will get all valid $\ln\left(\frac{1+\frac{1}{k}}{1-\frac{1}{k}}\right) = \ln\left(\frac{k+1}{k-1}\right)$ which means that when we will combine the fractions together and remove repeating terms from it we end up losing $(-1)^{n-1}$ as there's nothing to negate. This will lead to the final expression for $S$ being invalid for all even $n$. Therefore while this relation establishes a link between the "wrong" way I do it and the "safe" way to do it, it looks like it's not as simple as just replacing $n$ with $\frac{1}{n}$ and something is still amiss.