<s>[INST] Given $f(r) = r\tan^{-1} \frac{a}{r+b}$ where $a>0$ and $b>0$, find an expression for $r$ in terms of $f(r)$. Is there an analytical solution to the following problem:
Given $f(r) = r\tan^{-1} \frac{a}{r+b}$ where $a>0$ and $b>0$ find an expression for $r$ in terms of $f(r)$.
To me, it seems like there is an analytical solution to this problem. When I plot this out, $f(r)$ resembles a square root function.
I can also represent this equation as follows:
$tan(\frac{f(r)}{r}) = \frac{a}{r+b}$
Is there any way to determine if this has an analytical solution, and if it does, what is the solution? This represents a real geometric problem I just encountered which I've already solved by brute force. But, this equation interests me.
 [/INST] Around $r=0$, we can write the infinite sum for$$f=r \tan ^{-1}\left(\frac{a}{r+b}\right)$$ This gives
$$f=r \tan ^{-1}\left(\frac{a}{b}\right)+\sum_{n=1}^\infty \frac{(a-i b) (-b-i a)^{-n}+(a+i b) (-b+i a)^{-n}}{2 (n-1)}\, r^n$$ Truncate it to some order and, for more legibility, let $a=k b$
$$f=r \tan ^{-1}(k)-\frac{k r^2}{b (k^2+1)}+\frac{k r^3}{b^2 \left(k^2+1\right)^2}+\frac{k
   \left(k^2-3\right) r^4}{3 b^3 \left(k^2+1\right)^3}+\frac{k\left(1-k^2\right)
   r^5}{b^4 \left(k^2+1\right)^4}+O\left(r^6\right)\tag 1$$
Now use series reversion to obtain
$$r=\frac{f}{\tan ^{-1}(k)}+\frac{ k}{b \left(k^2+1\right) \tan ^{-1}(k)^3}f^2+\frac{ k \left(2 k- \tan ^{-1}(k)\right)}{b^2 \left(k^2+1\right)^2 \tan^{-1}(k)^5}f^3+O\left(f^4\right)\tag 2$$
Let us try using $a=2$, $b=3$. For $r=2$, this gives  $f=2 \tan ^{-1}\left(\frac{2}{5}\right)\sim 0.761013$.
Using $(2)$, this leads to $r=1.89841$ which does not seem too bad. For sure, this could be significantly improve at the price of more terms. Using for example all the terms present in $(1)$ (that is to say an expansion up to $O\left(f^6\right)$, it would give $r=1.9853$.
Edit
If you want more terms, we could write
$$r=\sum_{n=1}^p \frac {d_n} {\big[b\left(k^2+1\right)\big]^{n-1} x^{2 n-1} }\,f^n +O(f^{(p+1)})\qquad \text{with}\qquad x=\tan ^{-1}(k)$$ and the first $d_n$'s are
$$\left(
\begin{array}{cc}
n & d_n \\
 1 & 1 \\
 2 & k \\
 3 & k (2 k-x) \\
 4 & k \left(\left(5-\frac{x^2}{3}\right) k^2-5 x k+x^2\right) \\
 5 & -k \left(2 \left(x^2-7\right) k^3-x \left(x^2-21\right) k^2-9 x^2 k+x^3\right)
   \\
 6 & \left(\frac{x^4}{5}-\frac{28 x^2}{3}+42\right) k^5+\frac{28}{3} x
   \left(x^2-9\right) k^4-2 x^2 \left(x^2-28\right) k^3-14 x^3 k^2+x^4 k 
 \end{array}
\right)$$ The next ones are too long to be typed here.
For the worked example, the above table would give $r=1.99441$
</s>