# Finding a closed form for $((2\circledast3)\circledast4)\circledast\cdots\circledast n$, where $x \circledast y = \frac{x+y}{1+xy}$

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.
• Anyway passing to the complex numbers seems to be a possible way, I don't know much about this, but given that for $x<0$ it is true that $\log x = \log |x| + i\pi$ then maybe the Euler's identity $e^{i\pi} = -1$ or something similar comes into play because $\tanh$ and $\tanh^{-1}$ when composed are good condidates to apply the identity Commented Jul 22, 2022 at 11:04
• I never knew there was a mathjax symbol for the Galactice Empire.. $\circledast$ Commented Aug 21, 2022 at 14:31
• By the way, is this problem from a book or contest? If so, could you mention it? It somehow feels vaguely familiar to me but I'm not sure. Commented Aug 24, 2022 at 5:45
• contrary to popular belief you can do crazy shit like assume $\ln(ab) = \ln(a) + \ln(b)$ when constructing formulae over the complex numbers and as long as you have a restricted domain at the very end it all works out. For example when summing DIVERGENT series ex: 1 + 2 + 3 + ... =-1/12 you use functions and expressions in the wrong domains but still end up with results that aren't total nonsense. Generally speaking as long you are dealing with "analytic" functions; this kind of domain abuse is fine, if you start working with piecewise functions/more pathological crap is when the rigor counts Commented Aug 31, 2022 at 3:10
• Euler and Ramanujan style math are great examples of this principle Commented Aug 31, 2022 at 3:14

The proof is perfectly valid as is. Since the issue seems to be a general discomfort with complex numbers and multivalued functions, I'll start by addressing that. (In what follows, all logarithms are with base $$e$$. The only difference between ln and log as used below is that the notation $$\ln x$$ is reserved for the ordinary real-valued logarithm for $$x>0$$.)

When we write equations like $$\log(ab) = \log a + \log b$$ for the multi-valued complex logarithm, it means that every value of the left side is one of the values of the right side, and vice versa. To put it another way, it means that the set of values of the LHS equals the set of values of the RHS.

The trouble only starts if we tried to choose one of the multiple values to be the principal value. For example, using the usual choice of $$\operatorname{Log} z = \ln|z| + i \operatorname{Arg}(z)$$ with $$\operatorname{Arg}(z)$$ in the interval $$(-\pi, \pi]$$, then $$\operatorname{Log}(ab)$$ is not always equal to $$\operatorname{Log} a + \operatorname{Log} b$$. For example, with $$a = -2$$ and $$b = -3$$, we have: $$\operatorname{Log} a + \operatorname{Log} b = (\ln 2 + \pi i) + (\ln 3 + \pi i) = \ln 6 + 2 \pi i \ne \operatorname{Log}(6)$$ But if we don't try to single out a principal value, then nothing bad happens. In the multi-valued sense, $$\log(-2)$$ is $$\ln 2 + (2m + 1)\pi i$$ for any integer $$m$$, $$\log(-3)$$ is $$\ln 3 + (2n + 1)\pi i$$ for any integer $$n$$, and $$\log(6)$$ is $$\ln 6 + 2k \pi i$$ for any integer $$k$$. Every value of $$\log(-2) + \log(-3)$$ is one of the values of $$\log(6)$$, and vice versa. So, in an appropriate sense, the equation $$\log(ab) = \log a + \log b$$ remains valid.

Equations like $$e^{\log a} = a$$ are also still valid. Note that $$\log a$$ is multi-valued, but $$e^{\log a}$$ nevertheless has only one possible value.

Returning to the specifics of the question, $$\tanh^{-1} x = \frac{1}{2} \log\frac{1+x}{1-x}$$ is indeed a valid definition for all $$x \ne \pm 1$$, not just for $$-1 < x < 1$$. It still satisfies the identity $$\tanh(\tanh^{-1} x + \tanh^{-1} y) = \frac{x+y}{1+xy}.$$ Now we are thinking of it as complex and multi-valued, and all the intermediate steps of the proof involve multi-valued expressions; there is nothing wrong with that. Near the end we obtain the equation $$\frac{1}{2}\log\left(\frac{1+S}{1-S}\right) = \frac{1}{2}\log\left((-1)^{n-1}\frac{n(n+1)}{2}\right)$$ and there is no problem concluding that $$\frac{1+S}{1-S} = (-1)^{n-1}\frac{n(n+1)}{2}$$, because $$\log x = \log y$$ can only be true if $$x = y$$.

• I still have difficulties to believe that if sets on both sides of the equation have the same components, then the equality holds (for instance, depending on what we call"equality", sets {2, 3} and {3, 2} may or may not be equal which rings an alarm bell to me). But if it's indeed the case - hey, I accidentally came up with a valid proof to that stuff which I can also take as a win. I'd also like to know why the regularization through replacing x, y with 1/x, 1/y yields incorrect results. Commented Aug 23, 2022 at 18:18
• @AlmaDo If you have a doubt about the equality of "sets $\{2,3\}$ and $\{3,2\}$", you should not call them sets, because when defining a set by extension (i.e. by enumerating its elements), the elements order has no significance. Commented Aug 24, 2022 at 20:47

Just a fix not a proper solution

It has to do with the following property:

$$x \circledast y = \frac{1}{x} \circledast \frac{1}{y}$$

which implies that for odd $$n$$ we have

$$2 \circledast 3 \circledast \dots \circledast n = \frac{1}{2} \circledast \frac{1}{3} \circledast \dots \circledast \frac{1}{n}$$

and for even $$n$$ we have

$$2 \circledast 3 \circledast \dots \circledast n = \frac{1}{2} \circledast \frac{1}{3} \circledast \dots \circledast \frac{1}{n-1} \circledast {n}$$

• Well, this certainly gives a way to "fix" my solution to avoid the issues I mention (thanks for that, it's a neat observation). That is - if we apply this step before we start applying tanh and ln it all would make sense. However I don't get how it explains why the whole thing works the way it is - exactly because I do it "improperly". Commented Jul 21, 2022 at 21:18
• in the end the operations you apply work the same even if you use the incorrect representation because it is linked to the correct one by this relation Commented Jul 21, 2022 at 21:21
• i.e. the products in the ln are the same, both if you start from the wrong expression or the other – Commented Jul 21, 2022 at 21:24
• Hmm.. this will not yield the same result though. $(1+\frac{1}{k})/(1-\frac{1}{k}) = \frac{k+1}{k-1}$ so when we are proceeding from the logarithms we will definitely lose the $(-1)^{n-1}$ because there's nothing to negate. Hence the whole expression will look different. It will fail for $n=4$ (and any even $n$). Commented Jul 21, 2022 at 21:25
• look now I found the problem maybe! Commented Jul 21, 2022 at 22:16

I only want to give another approach to the problem.

Notice that if $$(x - x_1)(x - x_2) = x^2 + a_1x + a_2$$, then $$x_1 \circledast x_2 = \frac{x_1 + x_2}{1 + x_1x_2} = - \frac{a_1}{1 + a_2}$$. Also, one can easily compute that if $$(x - x_1)(x - x_2)(x - x_3) = x^3 + a_1x^2 + a_2x + a_3$$, then $$x_1 \circledast x_2 \circledast x_3 = \frac{x_1 + x_2 + x_3 + x_1x_2x_3}{1 + x_1x_2 + x_2x_3 + x_3x_1} = -\frac{a_1 + a_3}{1 + a_2}$$. So, what's your guess for a general formula?

Lemma: If $$(x - x_1)(x - x_2)\ldots(x - x_m) = a_0x^m + a_1x^{m-1} + \cdots + a_{m-1}x + a_m$$ then $$x_1 \circledast x_2 \circledast \cdots \circledast x_m = - \frac{\sum_{k \geq 0} a_{2k + 1}}{\sum_{k \geq 0}a_{2k}}.$$

The proof is easy, by induction on $$m$$. Thus, for finding $$S := 2 \circledast 3 \circledast \cdots \circledast n$$, we can let $$P(x) := (x - 2)(x - 3)\ldots(x - n) = a_0x^{n-1} + a_1x^{n-2} + \cdots + a_{n-2}x + a_{n-1}$$ and compute $$O := \sum_{k \geq 0}a_{2k+1}$$ and $$E := \sum_{k \geq 0} a_{2k}$$. We have: \begin{align*} E + O &= P(1) = (-1)^{n-1}.(n-1)!\\ E - O &= (-1)^{n-1}.P(-1) = (-1)^{n-1}.(-1)^{n-1}\frac{(n+1)!}{2} = \frac{(n+1)!}{2} \end{align*} Therefore \begin{align*} \frac{E + O}{E - O} = \frac{(-1)^{n-1} \times 2}{n^2 + n} \implies S = - \frac{O}{E} = \frac{1 - \frac{E + O}{E - O}}{1 + \frac{E + O}{E - O}} = \frac{n^2 + n - (-1)^{n-1} \times 2}{n^2 + n + (-1)^{n-1} \times 2}. \end{align*}

Your proof is valid since the expressions $$((2\circledast3)\circledast4)\circledast\cdots\circledast n$$ and $$\frac{x+y}{1+xy}$$ do not exceed $$1$$ (the latter expression for $$x>1$$ and $$y>1$$). Although I reckon other fellas have addressed your question very well (and I don't really have an added-value mathematical content:), I see a physical interpretation of your result, which may look interesting.

The expression $$\frac{x+y}{1+xy}$$ is famous in Physics. It gives the relativistic summation of normalized velocities (i.e. when the speed of light is assumed $$1$$). In other words, when inertial frame 2 moves at a speed of $$x$$ w.r.t. inertial frame 1 and inertial frame 3 moves at a speed of $$y$$ w.r.t. inertial frame 2, then inertial frame 3 moves at a speed of $$\frac{x+y}{1+xy}$$ w.r.t. inertial frame 1. The expression $$((2\circledast3)\circledast4)\circledast\cdots\circledast n$$ and $$\frac{x+y}{1+xy}$$ is simply a sequence of inertial frames, moving at different constant velocities w.r.t. one another. Since no relativistic summation of velocities can violate the speed of light, so does not the expression in your question, obviously.