Answer
See the detailed answer below.
Work Step by Step
$$\color{blue}{\bf [a]}$$
We can see from the given figures and from the geometry of the figure below, that the path length difference between the two rays is given by
$$\Delta r=\Delta r_2-\Delta r_1$$
where we can see that the orange ray (ray 1) travels an extra distance of $d\sin\phi$ to reach the next reflection part, while the blue ray (ray 2) travels an extra distance of $d\sin\theta$ to reach the wavefront.
Hence,
$$\Delta r=d\sin\theta-d\sin\phi$$
$$\boxed{\Delta r=d(\sin\theta-\sin\phi)}$$
$$\color{blue}{\bf [b]}$$
Equation 22.15, which the author told us to use, is
$$d\sin\theta_m=m\lambda $$
where $m\lambda=\Delta r$, so
$$ \Delta r=m\lambda $$
Plugging $\Delta r$ from the boxed formula above,
$$ d(\sin\theta-\sin\phi)=m\lambda $$
$$ \boxed{d \sin\theta_m=m\lambda +d\sin\phi}$$
where $m=0.\pm1,\pm2,\pm3,...$
the negative value of $m$ here will also give a diffraction angle which is different than the positive $m$s.
$$\color{blue}{\bf [c]}$$
when $m=0$,
$$d \sin\theta_0=(0)\lambda +d\sin\phi$$
$$d \sin\theta_0= d\sin\phi$$
Thus,
$$\boxed{\theta_0=\phi}$$
$$\color{blue}{\bf [d]}$$
Solving, $d \sin\theta_m=m\lambda +d\sin\phi$, for $\theta_m$,
$$ \theta_m= \sin^{-1}\left[\dfrac{m\lambda} {d}+\sin\phi\right]$$
Plugging the known, where $d=1/N$,
$$ \theta_m= \sin^{-1}\left[\dfrac{m(500\times 10^{-9})} {\dfrac{10^{-3}}{700}}+\sin40^\circ\right]$$
At $m=0$,
$$ \theta_0= \sin^{-1}\left[\dfrac{(0)(500\times 10^{-9})} {\dfrac{10^{-3}}{700}}+\sin40^\circ\right]=\color{red}{\bf 40^\circ}$$
At $m=1$,
$$ \theta_1= \sin^{-1}\left[\dfrac{(1)(500\times 10^{-9})} {\dfrac{10^{-3}}{700}}+\sin40^\circ\right]=\color{red}{\bf 83.11^\circ}$$
At $m=2$,
$$ \theta_1= \sin^{-1}\left[\dfrac{(2)(500\times 10^{-9})} {\dfrac{10^{-3}}{700}}+\sin40^\circ\right]=\color{red}{\bf Undefined}$$
So larger than $m\gt 1$ is not defined.
At $m=-1$,
$$ \theta_{(-1)}= \sin^{-1}\left[\dfrac{(-1)(500\times 10^{-9})} {\dfrac{10^{-3}}{700}}+\sin40^\circ\right]=\color{red}{\bf 17^\circ}$$
At $m=-2$,
$$ \theta_{(-2)}= \sin^{-1}\left[\dfrac{(-2)(500\times 10^{-9})} {\dfrac{10^{-3}}{700}}+\sin40^\circ\right]=\color{red}{\bf -3.28^\circ}$$
At $m=-3$,
$$ \theta_{(-3)}= \sin^{-1}\left[\dfrac{(-3)(500\times 10^{-9})} {\dfrac{10^{-3}}{700}}+\sin40^\circ\right]=\color{red}{\bf -24^\circ}$$
At $m=-4$,
$$ \theta_{(-4)}= \sin^{-1}\left[\dfrac{(-4)(500\times 10^{-9})} {\dfrac{10^{-3}}{700}}+\sin40^\circ\right]=\color{red}{\bf -49.2^\circ}$$
At $m=-5$,
$$ \theta_{(-5)}= \sin^{-1}\left[\dfrac{(-5)(500\times 10^{-9})} {\dfrac{10^{-3}}{700}}+\sin40^\circ\right]=\color{red}{\bf Undefined^\circ}$$
So less than $m\lt -4$ is not defined.
$$\color{blue}{\bf [e]}$$
See the last figure below.
Noting that the angles of $\theta$ are relative to the vertical axis.