# Numerical approximation by hand of arctan?

Is there any numerical method I can use by hand to solve an equation with $$\arctan$$?

I have for instance: $$2x\frac{180^\circ}{\pi}+\arctan(2x)=150^\circ$$ Or in radians: $$2x+\arctan(2x)=\frac{5\pi}{6}$$

Update:

With "by hand" I mean without a computer, just with pen, paper and a simple calculator.

• Might I guess that instead of $\frac{180}{\pi}$ you mean $\frac{180^∘}{\pi}=1$? So that the equation you want to solve is $$2x+\arctan(2x)=\frac{5\pi}6?$$ – Lutz Lehmann Oct 17 '19 at 8:57
• And what do you mean "by hand"? You are asking this using some kind of computer, there is surely a calculator app available, probably a spreadsheet program or even some scripting language. – Lutz Lehmann Oct 17 '19 at 9:02
• @LutzL Thanks for the comment, I updated my question. I mean in radians. "By hand" I mean without computer, just with pencil, paper and a simple calculator. – JDoeDoe Oct 17 '19 at 9:03
• @Gae.S. Thanks for the comment, I updated my question. – JDoeDoe Oct 17 '19 at 9:05
• So you can evaluate the arcus tangent with the required precision, no need to approximate that operation. – Lutz Lehmann Oct 17 '19 at 9:13

By inspection or graphing, you could notice that the function $$f(x)=2x+\tan^{-1}(2x)-\frac{5\pi}6$$ has a zero close to $$x=\frac \pi 4$$.

So, using Taylor around this point $$f(x)=\left(\tan ^{-1}\left(\frac{\pi }{2}\right)-\frac{\pi }{3}\right)+\left(2+\frac{8}{4+\pi ^2}\right) \left(x-\frac{\pi }{4}\right)+O\left(\left(x-\frac{\pi }{4}\right)^2\right)$$ Ignoring the higher order terms, then an approximation is given by $$x =\frac \pi 4+\frac{\left(4+\pi ^2\right) \left(\pi -3 \tan ^{-1}\left(\frac{\pi }{2}\right)\right)}{6 \left(8+\pi ^2\right)}\approx 0.802207$$ while the "exact" solution (using Newton method for example) would be $$0.802264$$.

This expansion gives the first iterate $$x_1$$ of Newton method starting with $$x_0=\frac \pi 4$$

• Hi! How did you get the fraction? Did you use you first equation $f(\frac{\pi}{4})=2\frac{\pi}{4}+\arctan(2\frac{\pi}{4})-\frac{5\pi}{6}$ and set this equal to your Taylor expansion? And then solved for $x$? – JDoeDoe Oct 17 '19 at 14:49
• @JDoeDoe. This is correct. – Claude Leibovici Oct 18 '19 at 7:49

The arcus tangent is nicely contractive, so that you can implement a fixed-point iteration $$x_{n+1}=\frac{5\pi}{12}-\frac12\arctan(2x_n)$$ or perhaps faster $$y_{n+1}=\frac{5\pi}{24}-\frac14(\arctan(2y_n)-2y_n)$$

n         x[n]                y[n]
-------------------------------------------
0   0                    0
1   1.3089969389957472   0.6544984694978736
2   0.7060332431802475   0.752140005235548
3   0.8316968384319999   0.7845414589967162
4   0.7942423418675012   0.7959216264499483
5   0.8045241611000699   0.7999849417244675
6   0.8016327513150959   0.8014438024522397
7   0.8024404675180803   0.8019685994905568
8   0.8022144096420561   0.8021575161901173
9   0.802277644078177    0.8022255394660307
10  0.8022599531289171   0.802250034816955
11  0.8022649022817598   0.802258855938407
12  0.8022635177097004   0.8022620325855991
13  0.8022639050555177   0.802263176559147
14  0.8022637966921317   0.8022635885272917


This is both not really converging fast, so one might apply some convergence accelerating measure like Atkins delta-squared process. Or construct some iteration that is more Newton like based on $$x_0=1$$. \begin{align} f(x)&=2x+\arctan(2x)-\frac{5\pi}6\\ f'(x)&=2+\frac2{1+4x^2}\\ x_{n+1}&=x_n-\frac{f(x_n)}{f'(x_0)}=\frac{0.4x_n-\arctan(2x_n)+\frac{5\pi}6}{2.4} \end{align}

 n       x[n]
--------------------
0  1
1  0.796185483415585
2  0.8026755902275313
3  0.8022364873312032
4  0.8022656372442502
5  0.8022636996224416
6  0.802263828406928
7  0.8022638198471882
8  0.8022638204161163
9  0.8022638203783021
10  0.8022638203808156
11  0.8022638203806486
12  0.8022638203806596
13  0.8022638203806589
14  0.8022638203806589


or go full Newton, but that requires more effort for a single step.

Writing the equation in the form $$x = \frac{5\pi}{12}-\frac 12 \arctan(2x$$), you realize that, considering the possibles values of $$\arctan(\cdot)$$, any solution must be in the interval $$[\frac{\pi}{6}, \frac{2 \pi}{3}]$$. So, take an initial guess in that interval, for instance $$x_0=\frac{\pi}{2}$$ and use newton's method $$x_{n+1} = x_n - \frac{2 x_n + \arctan (2x_n)-\frac{5 \pi}{6}}{2+\frac{2}{1+(2x_n)^2}}$$

this way you get $$x_3 = 0.802264$$ (only the last digit is not correct).

A relative simple, yet fairly accurate, analytic solution is given by

$$x=\frac{10}{57} + \frac{89}{228}\left(\frac{5\pi}{6}-\tan^{-1}\frac85\right)=0.802263$$

which can be derived by hand with a perturbation approximation.