Approximation of $\pi$ with $\tan(x/4) - \cot(x/4)$ and Newton`s method? If I find the Null in $\tan(x/4) - \cot(x/4)$ I should get a good approximation for $\pi$.
So I have
$$x_{n+1} = x_n - \frac{\tan(x/4) - \cot(x/4)}{\tan(x/4)dx - \cot(x/4)dx}$$
I've done this once before, but never got the result that I wanted.
So I'm sure I have to do some shaping of the terms before - do you have any hint?

The denominator is the derivative of the numerator, so the iteration formula should be:
$$\tag 1x_{n+1} = x_n - \dfrac{\tan\left(\dfrac x4\right) - \cot\left(\dfrac x4\right)}{\dfrac{1}{4} \csc ^2\left(\dfrac{x}{4}\right)+\dfrac{1}{4} \sec ^2\left(\dfrac{x}{4}\right)} = x_n + \dfrac{2 \cot \left(\dfrac{x}{2}\right)}{\csc ^2\left(\dfrac{x}{2}\right)} = x_n + \sin (x_n)$$
As noted in two comments, we could have done the trig simplification immediately, that is:
$$\tan\left(\dfrac x4\right) - \cot\left(\dfrac x4\right) = -2 \cot \left(\frac{x}{2}\right)$$
This greatly simplifies finding the iteration formula as you end up with the RHS of $(1)$ immediately. I left the solution as is to point out where your issue occurred, but the trig simplification is definitely preferred.
One has to be careful with the selection of $x_0$ given the graph of $-2 \cot \left(\frac{x}{2}\right)$:

If we start with $x_0 = 5$, we get a result of $3.1415926535897932385$ in five steps to $20-$digit accuracy.
