5
$\begingroup$

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

$\endgroup$
9
  • 1
    $\begingroup$ In what terms do you want the local extrema to be described? $\endgroup$ Commented Jan 16 at 4:23
  • 1
    $\begingroup$ In terms of n. We can find the maxima and minima for simple cases such as n = 1 (a constant function has no maxima/minima points), n = 2 (the cosine function has maxima and minima points at x = 0, $\pi$) $\endgroup$ Commented Jan 16 at 4:40
  • 1
    $\begingroup$ I recommend waiting at least a week before concluding "no answer" in math.se and posting here. $\endgroup$ Commented Jan 16 at 13:24
  • 1
    $\begingroup$ This function is also important in characterizing aliasing in discrete Fourier transforms, and in the limit as $n$ tends to infinity it generates the Dirac comb. $\endgroup$ Commented Jan 17 at 8:09
  • 1
    $\begingroup$ There is a series solution to the equation for general $n$ on MSE, but for small integer $n$, Carlo’s method works. $\endgroup$ Commented Jan 17 at 12:49

5 Answers 5

5
$\begingroup$

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)$$

$\endgroup$
8
  • 1
    $\begingroup$ 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. $\endgroup$ Commented Jan 17 at 7:48
  • 6
    $\begingroup$ @TomCopeland. Interesting remark ! I do not use plots (being blind) and this makes that I miss a lot of things. Thanks & cheers :-) $\endgroup$ Commented Jan 17 at 7:51
  • 2
    $\begingroup$ 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? $\endgroup$ Commented Jan 17 at 8:06
  • 1
    $\begingroup$ @TomCopeland Have a look at irie-at.com/product/vp-premier $\endgroup$ Commented Jan 17 at 8:09
  • 1
    $\begingroup$ Nice, but obscenely expensive. $\endgroup$ Commented Jan 17 at 8:17
6
$\begingroup$

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).

$\endgroup$
10
  • 2
    $\begingroup$ 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. $\endgroup$ Commented Jan 16 at 8:27
  • 1
    $\begingroup$ all solutions have absolute value of $z$ equal to 1, so $z=e^{ix}$ gives a real $x$. $\endgroup$ Commented Jan 16 at 9:02
  • $\begingroup$ 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$ ? $\endgroup$ Commented Jan 16 at 9:05
  • 1
    $\begingroup$ 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. $\endgroup$
    – Pierre PC
    Commented Jan 16 at 10:53
  • 1
    $\begingroup$ @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$. $\endgroup$ Commented Jan 17 at 7:18
4
$\begingroup$

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.)

$\endgroup$
2
  • 1
    $\begingroup$ Since you are not doing it yourself, this is a comment rather than an answer, isn't it? $\endgroup$
    – LSpice
    Commented Jan 16 at 15:33
  • 1
    $\begingroup$ @LSpice, possibly, but fitting it a comment was somewhat unreadable (I tried). $\endgroup$ Commented Jan 16 at 16:32
1
$\begingroup$

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)$.
$\endgroup$
3
  • 1
    $\begingroup$ What does "the function only has extrema" mean? $\endgroup$
    – LSpice
    Commented Jan 16 at 15:32
  • 3
    $\begingroup$ I think (not sure) that the intention is that "critical points are all extrema." $\endgroup$ Commented Jan 16 at 15:46
  • 1
    $\begingroup$ @LSpice Indeed, I meant what Willie Wong said. Not that I am using it anywhere, but I thought it would be of interest. $\endgroup$
    – Pierre PC
    Commented Jan 16 at 16:13
1
$\begingroup$

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.)

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .