Approximating zeros of $\tan(x) = 1/x$ I am a PDE university student and learning about the Wave equation:
$$u_{tt}=c^2u_{xx}$$
We are applying boundary conditions of the third kind:
$$ \begin{cases}
u_x(0,t)-u(0,t) = 0, \\
u_x(1,t) = 0.
\end{cases} $$
Using separation of variables for $X$ we get:
$$ X(x) = \sin(\sqrt{\lambda}x) + 
\cos(\sqrt{\lambda}x). $$
Applying boundary conditions to this we get:
$$ \bbox[color:navy; border:1px dotted navy; padding:5px;]{ \tan(\sqrt{\lambda}) = \frac{1}{\sqrt{\lambda}} }$$
In class, we just use Desmos to get values of $\lambda$ but I was trying to find a way to approximate $\lambda$ using series:

Let $\sqrt{\lambda}=x$.
$$ \tan(x) = \frac{\sin(x)}{\cos(x)}.$$
Using $\sin$ and $\cos$ series
\begin{align*}
\sin(x) &= \sum_{n=0} \frac{(-1)^n}{(2n+1)!}x^{2n+1}, &
\cos(x) &= \sum_{n=0} \frac{(-1)^n}{(2n)!}x^{2n},
\end{align*}
we get:
\begin{align*}
& \tan(x) = \frac{\sum_{n=0} \frac{(-1)^n}{(2n+1)!}x^{2n+1}}{\sum_{n=0} \frac{(-1)^n}{(2n)!}x^{2n}} = \frac{1}{x} \\
&\quad\iff\quad
\sum_{n=0} \frac{(-1)^n}{(2n+1)!}x^{2n+1} = \frac{1}{x} \sum_{n=0} \frac{(-1)^n}{(2n)!}x^{2n} \\
&\quad\iff\quad
\sum_{n=0} \frac{(-1)^n}{(2n+1)!}x^{2n+1} = \sum_{n=0} \frac{(-1)^n}{(2n)!}x^{2n-1} \\
&\quad\iff\quad
\sum_{n=0} \left( \frac{(-1)^n}{(2n+1)!}x^{2n+1} - \frac{(-1)^n}{(2n)!}x^{2n-1} \right) = 0 \\
&\quad\iff\quad
\frac{1}{x} + \sum_{n=0} (-1)^n \left( \frac{1}{(2n+1)!}-\frac{1}{(2n+2)!} \right)x^{2n+1} = 0.
\end{align*}

At this step I am not sure where to go next. I have a simple polynomial and the $\frac{1}{x}$ term, I was hoping I could selectively pick values of $n$ for the summation to get values for $\lambda_n$ but I don't know how to procedurally solve this summation. Any help or advice appreciated :)
 A: So if you are using this method, I'd probably recommend doing something like transforming $\frac{\sin x}{\cos x} = \tan x = \frac{1}{x}$ into something like $x\sin x - \cos x = 0$, so that you are essentially looking for zeros of the function $f(x) = x\sin x - \cos x$. This is a very common first step for solving intersections because now we are looking at a function that is defined everywhere and actually has a reasonable power series expansion:
$$f(x) = x\sin x - \cos x = x\sum_{n=0}^\infty \frac{(-1)^nx^{2n+1}}{(2n+1)!} - \sum_{n=0}^\infty \frac{(-1)^nx^{2n}}{(2n)!} = -1 - \sum_{n=1}^\infty(-1)^n\left(\frac{2n+1}{(2n)!}  \right)x^{2n} $$
Now to approximate a root, we could truncate the series to get a polynomial, say $f(x) \approx -1 + \frac{3}{2}x^2$, which has the roots $x = \sqrt{\frac{2}{3}} \approx .8165$ compared to the true value of $.8603$. The quartic polynomial $f(x) \approx -1 + \frac{3}{2}x^2 - \frac{5}{24}x^4$ does a bit better with root $x = \sqrt{\frac{18-2\sqrt{51}}{5}} \approx .8622$. But in general you can see that this is not a good method for approximating $\lambda_n$ because it requires solving for roots of polynomials, and also the McLauren series is centered at 0 so this doesn't even get close to solving any other solution to $\tan x = 1/x$, only the one closest to $x = 0$. You are much better off using any basic root finding algorithm on $f(x) = x\sin x - \cos x$, such as Newton's method, to approximate roots then a Taylor's series method. It also allows you to find any root you want as long as your initial guess is close enough, and since $\tan x = 1/x \approx 0$ for large $x$, any initial value slightly larger than $n \pi$ for $n$ an integer will zoom in on $\lambda_n^2$ rather quickly with Newton's method.
Edit: I just want to summarize I guess, the best way to numerically calculate the value $\lambda_n^2$ is to use Newton's method on $f(x) = x\sin x -\cos x$ with starting guess $n\pi$. The only exception is $\lambda_0^2$, the root closest to the origin, which is approximately $.8622$ but can also be found by Newton's method using a starting value somewhat close to this.
