An intriguing definite integral: $\int_{\pi/4}^{\pi/2} \frac{x^2+8}{(x^2-16)\sin (x) + 8 x \cos(x)} \ dx$ I need some hints, suggestions for the following integral
$$\int_{\pi/4}^{\pi/2} \frac{x^2+8}{(x^2-16)\sin (x) + 8 x \cos(x)} \ dx$$
Since it's a high school problem, I thought of some variable change, integration by parts, but I can't see yet how to make them work. I don't know where I should start from. Thanks!

Following up on Blue's comment:
In general
$$
a\sin x+b\cos x = \sqrt{a^2+b^2}\Big( \frac{a}{\sqrt{a^2+b^2}}\sin x + \frac{b}{\sqrt{a^2+b^2}}\cos x \Big) = \sqrt{a^2+b^2} \left(\cos\varphi\sin x+\sin\varphi\cos x\right) = \sqrt{a^2+b^2}\sin(x+\varphi),
$$
so $\tan\varphi = \dfrac b a$.
Now putting in $a=x^2-16$ and $b=8x$, we have
$$
\begin{align}
\Big( x^2 - 16 \Big)^2 + \Big(8x\Big)^2 & = \Big(x^4 - 32x^2 + 256\Big) + \Big(64x^2\Big) \\[10pt]
& = x^4 + 32x^2 + 256 = \Big( x^2 + 16 \Big)^2
\end{align}
$$
Therefore
$$
(x^2-16)\sin x + 8x\cos x = (x^2+16)\sin(x+\varphi)
$$
where
$$
\varphi = \arctan\frac{8x}{x^2-16}. \tag{1}
$$
The answer from sos440 doesn't explain how s/he thought of that susbstitution in the first place, but conjoining that with $(1)$, I'm thinking: let's see if that last fraction in $(1)$ is the tangent of a double angle.  Remember that
$$
\tan(2\alpha) = \frac{2\tan\alpha}{1-\tan^2\alpha}.
$$
Therefore
$$
\frac{8x}{x^2-16} = \frac{2(-x/4)}{1-(-x/4)^2} = \tan(2\alpha)\text{ where } \tan\alpha = \frac{-x}{4}.
$$
After that, proceed as in the answer from sos440.
