Question: I am working on a physics reserach project for school and I have run into some troubles working Mathematica. I am a fairly inexperienced mathematica user so any help would very much be appreciated.

I need to find the roots of the transcendental equation 
$$\zeta\_n \tan(\zeta) - \sqrt{R^2-\zeta^2\_n}=0$$
and then collect them into a list, $\{\zeta\_n\}$, which I can sum over.

FindRoot works but only finds one root at a time. For example $R^2=18$ gives

> 
> FindRoot[Sqrt[18. - zeta^2] - zeta Tan[zeta] == 0, {zeta, 3}]
> 
> 
> {zeta -> 3.66808}
>  From a plot of the function I know there should be two roots for this particular value of $R$, however FindRoot only gives one.
> 
> 
> 

I have had no luck with NSolve or Solve either. 

> 
> NSolve[xi[zeta, Erg4]- zeta\*Tan[zeta] == 0, zeta]
> 
> 
> NSolve[Sqrt[18. - zeta^2] - zeta Tan[zeta] == 0, zeta]
> 
> 
> 

Also once I have succeeded in finding all roots how does one put them in an indexed set ${\zeta\_n}$.

Answer: 
```
With[{maxR = 10},
 Manipulate[
  expr = Sqrt[R^2 - zeta^2] - zeta Tan[zeta];
  zero = zeta /. NSolve[{expr == 0,
       R^2 - zeta^2 >= 0}, zeta] // Quiet;
  Column[{
    Plot[expr, {zeta, -maxR, maxR},
     Exclusions -> {Cos[zeta] == 0},
     PlotRange -> {{-maxR, maxR}, {-25, 40}},
     Epilog -> {Red, AbsolutePointSize[4],
       Point[{#, 0} & /@ zero]},
     AspectRatio -> 1],
    zero},
   Alignment -> Center],
  {{R, Sqrt[18]}, 0, maxR, Appearance -> "Labeled"}]]

```

![enter image description here](https://i.stack.imgur.com/8xcBF.png)
I'm going to guess that you're trying to solve for the even states of the finite square well in quantum mechanics. Note that the number of roots is just determined by $R$, and is `Floor[R/π]`; plot the graphs of $\zeta \tan \zeta$ and $\sqrt{R^2 - \zeta^2}$ to see why this is so. Moreover, it's not too hard from this graph to see that the first root will always be in the region $[0, \pi/2)$; the second root will be in the range $[\pi, 3\pi/2)$; the third will be in the range $[2\pi, 5\pi/2)$; and so forth. 

`FindRoot` allows for an option where you can provide it with values $\{ x, x\_{start}, x\_{min}, x\_{max}\}$, which will search for a root within the interval $[x\_{min}, x\_{max}]$. Since we know where the roots are for this function, we can take advantage of this functionality like so:

```
nroots[R_] := Floor[R/\[Pi]] + 1;
roots[R_] := Table[FindRoot[Sqrt[R^2 - ζ^2] - ζ Tan[ζ] == 0,
 {ζ, n π + π/4, n π, n π + π/2}], {n, 0, nroots[R] - 1}]

nroots[3√2]
(* {{ζ -> 1.26743}, {ζ -> 3.66808}} *)

```

The analogous problem for the odd-parity states is left as an exercise for the student. :-)