I encountered this sum $$S(N,j)= \frac{2 \sqrt{2}h(-1)^j}{N+1}\cdot\sum _{n=1}^{\frac{N}{2}} \frac{\sin ^2\left(\frac{\pi j n}{N+1}\right)}{\sqrt{2 h^2+\cos \left(\frac{2 \pi n}{N+1}\right)+1}},$$ where $h\in \mathbb{R}^+, \{n,j\}\in \mathbb{Z}^+$ and $N\to \infty.$
It has the curious property that for a fixed $h$ (say $5/4$) as $N$ increases, the value of the sum seems to be the same for all values of $j$ other than the first few ($j=1,2,3,\ldots$) and the last few $j=N,N-1,N-2,\ldots$, otherwise there is a single value $a$, which alternates in sign i.e. $$S(N,j)=(\ldots, a,-a,a,-a,\ldots).$$
Is it possible to obtain an expression for $S(N,j)$ by summing over $n$, either for finite $N$ or if that's not possible is it possible to obtain $$\lim_{N\to \infty} S(N,j)$$ or at least the value of $|a|$?
The following computes that $\lim_{j \to \infty} \lim_{N \to \infty} S(N,j,h) = \int_0^{1/2} \frac{h}{\sqrt{h^2 + \cos^2(\pi x)}} \mathrm{d}x.$ This at least tells us the limiting value, $a$, seen in the post, but in my opinion it is not satisfactory as an explanation of the observations because a) it doesn't explain the behaviour for $j$ linearly large in $N$, and b) it doesn't explain the fairly fast convergence of the sum to the integral. Ideally one would explain why the sum already matches the limit to $10^{-5}$ at, e.g., $j = 5, N = 100,$ and the same at $j = 995, N = 1000$. Perhaps a Fourier theoretic lens is useful?
Through the usual Riemann sum developement, it holds that as $N \to \infty,$ $$ \sum_{n = 1}^{N/2} \frac{1}{N+1} \frac{\sin^2 ( \pi j \cdot(n/N+1)) }{ \sqrt{2 h^2 +1 + \cos(2\pi (n/N+1))} } \to \int_0^{\frac 12} \frac{\sin^2(\pi j x)}{\sqrt{2h^2 +1 + \cos(2\pi x)}} \mathrm{d}x.$$
Note that $\cos(2\pi x) = 2\cos^2(\pi x) - 1.$ Further the alternating sign in your observations is clearly coming from the $(-1)^j$ term, so we can ignore that factor. This means that we need to study $$ I(j,h) := 2 \int_0^{1/2} \frac{h \sin^2(\pi j x)}{\sqrt{h^2 + \cos^2(\pi x)}}\mathrm{d}x$$ Let us substitute $y = j x$ to get $$ I(j,h) = \frac{ 2}{ j} \int_{0}^{j /2} \frac{h \sin^2(\pi y)}{\sqrt{h^2 + \cos^2(\pi y/j)}} \mathrm{d}y.$$
Now, the numerator in the integrand has a period of $1$. However, notice that for large $j$ the denominator varies very slowly over an interval of length $1$. Indeed, we have that over any interval $[k,k+1)$ where $k \le j/2$ is a natural, we have $$ \cos^2(\pi k/j) \le \cos^2(\pi y/j) \le \cos^2(\pi (k+1)/j),$$ and $$ |\cos^2(\pi k/j) - \cos^2(\pi (k+1)/j)| = \sin (\pi/j) \sin(\pi (2k+1)/j) \le \pi/j.$$
So, we have $L(j,h) \le I(j,h) \le U(j,h),$ where $$ L(j,h) := \frac{2}{j}\sum_{k = 0}^{\lfloor j/2\rfloor} \int_0^{1} \frac{h \sin^2(\pi x)}{\sqrt{h^2 + \cos^2(\pi k/j)} } \\ U(j,h) := \frac{2}{j}\sum_{k = 0}^{\lfloor j/2\rfloor} \int_0^{1} \frac{h \sin^2(\pi x)}{\sqrt{h^2 + \cos^2(\pi(k+1)/j)} } + \frac{2}{j}\int_{\lfloor j/2\rfloor}^{j/2} \sin^2(\pi x)$$
Of course, the integral of $\sin^2$ over its period is simply $1/2$, so
$$ L(j,h) = \frac{1}{j} \sum_{k = 0}^{\lfloor j/2\rfloor} \frac{h}{\sqrt{h^2 + \cos^2( \pi k /j)}} \\ U(j,h) = \sum_{k = 0}^{\lfloor j/2\rfloor} \frac{h}{\sqrt{h^2 + \cos^2( \pi (k+1) /j)}} + O(1/j).$$ But again notice that up to $O(1/j)$ corrections, the form of the bounds $L$ and $U$ is the same as the lower and upper Darboux sums for the map $ u \mapsto \frac{h}{\sqrt{h^2 + \cos^2(\pi u)}}$ evaluated over the standard partition of size $1/j$ on the interval $[0, 1/2)$. It follows that as $j \to \infty$, $$ L(j,h) \to f(h) := \int_0^{1/2} \frac{h}{\sqrt{h^2 + \cos^2(\pi x)}} \mathrm{d}x, $$ and $U(j,h) \to f(h)$ as well, and hence $I(j,h) \to f(h)$ by squeezing.