5

FYI: I asked this question here couple of days ago but got no answer yet.

$n$ is an integer

We know the global maximum of the function $\sin(nx)/\sin(x)$ is $n$ (thanks to this question), but what are the local maxima and minima points of the function in $(-\pi,\pi)$? (it represents the intensity of a narrow slit diffraction grating)

I tried equating the derivative to $0$ and the equation to be solved is $n\tan(x) = \tan(nx)$. I am unable to progress from here. I also tried expanding $\sin(nx)$ using multiple-angle formula but made no progress.

For convenience: 1st derivative $$ = \frac{n\cos(nx)\sin(x) - \sin(nx)\cos(x)}{\sin(x)^2}$$and 2nd derivative = $$\frac{2\sin(nx)\cos(x)^2 + \sin(nx)\sin(x)^2 - n^2\sin(nx)\sin(x)^2 - 2n\cos(nx)\cos(x)\sin(x)}{\sin(x)^3}$$

Here is a plot of the function in Desmos: https://www.desmos.com/calculator/kt0hntsbcb

5 Answers5

6

You need to solve the following equation for $z=e^{ix}$ $$\left(z^2+1\right) \left(z^{2 n}-1\right)-n \left(z^2-1\right) \left(z^{2 n}+1\right)=0.$$ Wolfram Alpha can do that for you. The answer is in radicals for $n\leq 7$,for example $$n=7\Rightarrow z=\sqrt{\frac{1}{6} \left(\sqrt{7}+i \sqrt{2 \left(\sqrt{7}+14\right)}-1\right)}.$$ Note that $|z|=1$, so $x$ is real. This is one of the solutions, for the others you vary the sign of the square roots (and there are also roots at $\pm 1$ and $\pm i$, see figure).

Carlo Beenakker
  • 177,695
  • 2
    It seems you looked for the case where df/dz = 0, and you got non-real solutions. However, it seems the original question (judging by the desmos graph) is about the real solution of a real analytic function. I believe that if you want to the z=exp(ix) substitution you have to ask for which real values the derivative is pure imaginary. – David Lehavi Jan 16 '24 at 08:27
  • 1
    all solutions have absolute value of $z$ equal to 1, so $z=e^{ix}$ gives a real $x$. – Carlo Beenakker Jan 16 '24 at 09:02
  • don't you have to add an algebraic equation to account for $|z|=1$ ? i.e. take $z=a+ib$, and require $a^2+b^2 = 1$ ? – David Lehavi Jan 16 '24 at 09:05
  • or, you can just take your equation and throw in the $|z|=1$ into the algebra with a resultant --- see my answer (which builds on yours) below. – David Lehavi Jan 16 '24 at 09:14
  • 1
    I think there is a sign error and the $n$ should be $-n$. Given this, every $x$ that is a critical point will give a solution $e^{ix}$ of your equation. It is clear (say from the sign of $\sin(nx)$) that the function will have at least $2n$ extrema, and one can check that 1 and -1 are always double roots, so the $(2n+2)$ roots of your equation have to correspond to extrema, and in particular lay on the circle. – Pierre PC Jan 16 '24 at 10:53
  • @PierrePC --- typo corrected (n --> -n); and thank you for the unit circle argument! – Carlo Beenakker Jan 16 '24 at 11:00
  • I have to correct myself: the function has at least $2(n-1)$ extrema, which correspond to $2(n-1)$ roots of the polynomial on the circle. But 1 and -1 are triple roots, so this accounts for $2(n-2)$ simple and $2$ triple roots, i.e. all the $2(n+1)$ roots of your equation, and going back to the initial question we must have exactly $2(n-1)$ critical points (which are extrema). – Pierre PC Jan 16 '24 at 12:37
  • @CarloBeenakker, I am still trying to figure out how we went from $n\tan(x) = \tan(nx)$ to the first equation in your answer. I must be missing something. Can you give me a hint? – RajaKrishnappa Jan 17 '24 at 02:59
  • 1
    @RajaKrishnappa : multiply both sides of the equation by $\cos x \cos nx$, to get $n\cos nx \sin x = \cos x \sin nx$, then represent the sines and cosines by the complex exponentials, $\cos nx = (1/2)(z^n+1/z^n)$, and so on. Finally multiply by $z^{n+1}$ to remove the inverse powers of $z$. – Carlo Beenakker Jan 17 '24 at 07:18
  • Much improved. Have a look at the new version of my answer – Claude Leibovici Jan 18 '24 at 05:15
5

Have a look at my answer to this question.

For a given $n$, excluding the two trivial solutions $x=0$ and $x=\pi$, using $$x= \frac {\pi\, y}{n} \qquad\text{for}\qquad y \in (0,n)$$

a rather good first estimate of the $k^{\text{th}}$ root is given by $$y_k^{(0)} = k+\frac 12\qquad \implies \qquad \large\color{blue}{x_k^{(0)}=\frac {(2k+1)\, \pi}{2n}}$$ Trying for $n=10$ as in your plot

$$\left( \begin{array}{ccc} k & y_k^{(0)} & \text{solution} \\ 1 & 1.5 & 1.43516 \\ 2 & 2.5 & 2.46763 \\ 3 & 3.5 & 3.48359 \\ 4 & 4.5 & 4.49491 \\ 5 & 5.5 & 5.50509 \\ 6 & 6.5 & 6.51641 \\ 7 & 7.5 & 7.53237 \\ 8 & 8.5 & 8.56484 \\ \end{array} \right)$$

The first iterate of Newton method already improves

$$y_k^{(1)} =y_k^{(0)}-\frac{n}{\pi }\,\frac{\cot \left(\frac{\pi }{n}y_k^{(0)}\right)}{n^2-2 \csc ^2\left(\frac{\pi }{n}y_k^{(0)}\right)+1}$$ which would imply $$\large\color{blue}{x_k^{(1)} =x_k^{(0)}-\frac{\cot \bigg(x_k^{(0)}\bigg)}{n^2-\csc ^2\bigg(x_k^{(0)}\bigg)}}$$

Repeating the calculations for $n=10$, the results $$\left( \begin{array}{ccc} k & y_k^{(1)} & \text{solution} \\ 1 & 1.43157 & 1.43516 \\ 2 & 2.46718 & 2.46763 \\ 3 & 3.48353 & 3.48359 \\ 4 & 4.49490 & 4.49491 \\ 5 & 5.50510 & 5.50509 \\ 6 & 6.51647 & 6.51641 \\ 7 & 7.53282 & 7.53237 \\ 8 & 8.56843 & 8.56484 \\ \end{array} \right)$$

Repeating the calculations in terms of $x$

$$\left( \begin{array}{cccc} k & x_k^{(0)} & x_k^{(1)} & \text{solution} \\ 1 & 0.47124 & 0.45061 & 0.45087 \\ 2 & 0.78540 & 0.77519 & 0.77523 \\ 3 & 1.09956 & 1.09440 & 1.09440 \\ 4 & 1.41372 & 1.41212 & 1.41212 \\ 5 & 1.72788 & 1.72948 & 1.72948 \\ 6 & 2.04204 & 2.04720 & 2.04719 \\ 7 & 2.35619 & 2.36640 & 2.36636 \\ 8 & 2.67035 & 2.69098 & 2.69072 \\ \end{array} \right)$$

This means that using the $\color{red}{\text{first}}$ iterate of an higher order method (Halley, Householder or higher), we can have better and better explicit approximations.

This is illustrated below $$\left( \begin{array}{ccccc} k & \text{Newton}& \text{Halley}& \text{Householder}& \text{solution} \\ 1 & 0.4506120 & 0.4510008 & 0.4508669 & 0.4508697 \\ 2 & 0.7751941 & 0.7752448 & 0.7752278 & 0.7752279 \\ 3 & 1.0943972 & 1.0944039 & 1.0944016 & 1.0944016 \\ 4 & 1.4121164 & 1.4121166 & 1.4121166 & 1.4121164 \\ 5 & 1.7294762 & 1.7294760 & 1.7294761 & 1.7294762 \\ 6 & 2.0471955 & 2.0471888 & 2.0471910 & 2.0471910 \\ 7 & 2.3663986 & 2.3663478 & 2.3663649 & 2.3663648 \\ 8 & 2.6909806 & 2.6905919 & 2.6907258 & 2.6907230 \\ \end{array} \right)$$

  • 1
    One can arrive at your first estimate rather quickly graphically with Desmos if $y = \sin( n \pi x)$ and $y = \frac{ \sin( n \pi x)}{ \sin(\pi x)}$ are juxtaposed, and the periodicity and the correlations among the zeros and extrema of the two curves noted. – Tom Copeland Jan 17 '24 at 07:48
  • 6
    @TomCopeland. Interesting remark ! I do not use plots (being blind) and this makes that I miss a lot of things. Thanks & cheers :-) – Claude Leibovici Jan 17 '24 at 07:51
  • 2
    I knew a blind girl who was one of the top students in her calculus class. She wrapped rubber bands around pins / nails to form curves and acquire some intuition that way. I would hope with advancements in 3-D printing, computer manipulation of beds of fine pins, or braille printing that there is some way to quickly get some tactile feelings for these types of curves for those who might wish to. Are there braille printers for plotting now? – Tom Copeland Jan 17 '24 at 08:06
  • 1
    @TomCopeland Have a look at https://irie-at.com/product/vp-premier/ – Claude Leibovici Jan 17 '24 at 08:09
  • 1
    Nice, but obscenely expensive. – Tom Copeland Jan 17 '24 at 08:17
  • 1
    From https://mathoverflow.net/questions/32479/what-are-some-mathematical-sculptures/252321#252321: For once, the ability to visualize may actually have been a handicap. It was left to the blind mathematician Bernard Morin to devise a procedure to turn a sphere inside out that could actually be implemented (if the membrane is able to pass through itself, that is.) – Tom Copeland Jan 17 '24 at 15:27
  • 1
    @TomCopeland Much improved. Have a look at the new version of my answer – Claude Leibovici Jan 18 '24 at 05:17
  • 1
    You can halve the work by noting the symmetry in reading off the values of the extrema for your list of 8 ordinates. Only the first four are unique in absolute value. See the extrema listed in my supplemental response/answer. – Tom Copeland Jan 18 '24 at 19:54
4

Following on Carlo's answer:

One has to solve $\Re(((a+ib)^2+1)((a+ib)^{2n}+1)+n((a+ib)^2-1)((a+ib)^{2n}+1)) = 0$

under the requirement that $a+ib$ is a point on the unit circle; i.e. $a^2+b^2=1$.

At this point you have to explicitly write the real part of the RHS of the equation at the top. This gives you an expression of the form $f(a^2,b) + a g(a^2,b) = 0$. Substitute $a^2=1-b^2$, and use the resultant to get rid of the singleton $a$. (I'm not doing this myself since it doesn't seem particularly fun.)

LSpice
  • 11,423
David Lehavi
  • 4,309
1

Going in a slightly different direction, let me give an approximate expression for the critical points.

From Carlo Beenakker's answer and my comment there, we know that the function only has extrema, and it has precisely one of those in every interval $[\frac\pi nk,\frac\pi n(k+1)]$. They are in the interior of the interval, except for $k$ in $n\mathbb Z$ or $-1+n\mathbb Z$, in which case they account for the global extrema at $\pi\mathbb Z$.

Let $x=x_{k,n}$ be the only extremum of your function in the interval above. From your expression for the derivative, we get $$ \tan(nx)=n\tan(x). $$ Set $u=nx-\pi k$; by definition $u\in(0,\pi)$. Expanding the above expression, we get $$ \tan(u)=n\tan\left(\frac{\pi k+u}n\right). $$

  • If $k$ is bounded positive, then letting $f$ be the inverse of $v\mapsto\tan(v)-v=\pi k$ over $(0,\pi/2)$, we get $$ u = f\left(n\tan\left(\frac{\pi k+u}n\right)-u\right) = f(\pi k)+O(1/n^2). $$ With more effort, one gets an asymptotic expansion in $1/n$. A similar expression holds for $k$ negative by noting that in this case, $\tan(u)<0$ so $u=\pi+\arctan(\tan(u))$.
  • If $k/n\in(\varepsilon,1/2]+\mathbb Z$, then $$ u = \frac\pi2-\arctan\left(\frac1n\cot\left(\frac{\pi k+u}n\right)\right) = \frac\pi2-\frac1n\cot\left(\frac{\pi k}n\right)+O(1/n^2) $$ as $n$ goes to infinity, where the constant in the $O$ term depends only on $\varepsilon$. As above, a similar expression holds for $k/n\in[-1/2,-\varepsilon)$.
  • If $k/n\in[0,1/2-\varepsilon)+\mathbb Z$, then $$ u = \frac\pi2-\arctan\left(\frac1n\cot\left(\frac{\pi k+u}n\right)\right) = \frac\pi2-\arctan\left(\frac1{\pi k+u}\right)+O(1/n), $$ which gives $$ u=\frac\pi2-\frac1{\pi k}+O(1/k^2)+O(1/n) $$ if $k\to\infty$. The same thing goes for $k/n\in(-1/2+\varepsilon,0]+\mathbb Z$. This estimate is probably most useful when $k/n\to0$, in which case we can replace $O(1/n)$ by $O(k/n^2)$.
LSpice
  • 11,423
Pierre PC
  • 2,999
1

Symmetry can be used to halve the computational work.

For example, first display a graph of

$S(x) = \frac{\sin(N \pi x)}{\sin(\pi x)}$

by cutting and pasting (w/o the quotes) into the online graphing calculator Desmos

"S\left(x\right)\ =\frac{\sin\left(N\ \pi\ x\right)}{\sin\left(\pi\ x\right)}".

(Edit 1/24/24: I had to open the MO edit window to copy the later expressions in quotes to paste into Desmos for some strange reason, with Chrome.)

Note the period is $2$ for $N =10$ or any even $N > 1$. (The period is $1$ for odd $N$.)

Now look at the odd shifted version

$O(x) = S(x-.5) = -O(-x)$

over the interval $-.5 \leq x \leq .5$ with C&P of

"\left{-.5<x<.5:\frac{\sin\left(N\ \pi\ \left(x-.5\right)\right)}{\sin\left(\ \pi\ \left(x-.5\right)\right)}\right}".

Clearly we need only find four extrema (the global max at $x=.5$ is $O(.5) = S(0) = 10$) as depicted by

"\left{0<x<.5:\frac{\sin\left(N\ \pi\ \left(x-.5\right)\right)}{\sin\left(\ \pi\ \left(x-.5\right)\right)}\right}".

Superposing $y = \sin(N \pi x)$, we easily see that the ordinates of the four extrema are

near $x_0 = (0+1/2)/10 = .05$ with $O(.05) \approx 1.01247$ [graph $(.051,1.013)$];

near $x_1 = (1+1/2)/10 = .15$ with $O(.15) \approx -1.12233$ [graph $(.152,-1.124)$];

near $x_2 = (2+1/2)/10 = .25$ with $O(.25) \approx 1.41421$ [graph $(.253,1.421)$];

near $x_3 = (3+1/2)/10 = .35$ with $O(.35) \approx -2.20269$ [graph $(.356,-2.247)$].

Comparing with the extrema using the ordinates found by Claude Leibovici for $f(x) = \frac{\sin(N x)}{\sin(x)}$:

$f(0.4508697) \approx -2.24746$

$f(0.7752279) \approx 1.42144$

$f(1.0944016) \approx -1.1238$

$f(1.4121164) \approx 1.01259$

$f(1.7294762) \approx -1.01259$

$f(2.0471910) \approx 1.1238$

$f(2.3663648) \approx -1.42144$

$f(2.6907230) \approx 2.24746$,

which reflect the symmetries.

(For $N$ odd, $h(x) = S(x-.5) = S(-x-.5) = h(-x)$ is an even function and the symmetries can again be used to reduce the work.)

Tom Copeland
  • 9,937