More on the generalized integral Refer to my previous topic: Definite integral, quotient of logarithm and polynomial: $I(\lambda)=\int_0^{\infty}\frac{\ln ^2x}{x^2+\lambda x+\lambda ^2}\text{d}x$
I think we get this :
$$\frac{\sin \theta}{1-2\cos \theta x+x^2}=\sum_{k=1}^{\infty}\sin (k\theta )x^{k-1}$$
Then $$\int_0^1\frac{\ln ^2x}{1-2\cos \theta x+x^2}\text{d}x=\frac{2}{\sin \theta}\sum_{k=1}^{\infty}\frac{\sin (k\theta)}{k^3}=\frac{2}{\sin \theta}\left(\frac{\pi ^2\theta}{6}-\frac{\pi \theta ^2}{4}+\frac{\theta ^3}{12}\right)$$
Moreover $$\begin{align}
  & I\left( \lambda ,\theta  \right)=\int_{0}^{\infty }{\frac{{{\ln }^{2}}x}{{{x}^{2}}-2\lambda x\cos \theta +{{\lambda }^{2}}}\text{d}x}=\int_{0}^{\infty }{\frac{{{\ln }^{2}}x}{{{\lambda }^{2}}{{x}^{2}}-2\lambda x\cos \theta +1}\text{d}x} \\ 
 & \ \ \ \ \ \ \ \ \ \ \ =\frac{1}{\lambda }\int_{0}^{\infty }{\frac{{{\left( \ln x-\ln \lambda  \right)}^{2}}}{{{x}^{2}}-2\cos \theta x+1}\text{d}x}=\frac{{{\ln }^{2}}\lambda }{\lambda }\int_{0}^{\infty }{\frac{1}{{{x}^{2}}-2\cos \theta x+1}\text{d}x}+\frac{1}{\lambda }\int_{0}^{\infty }{\frac{{{\ln }^{2}}x}{{{x}^{2}}-2\cos \theta x+1}\text{d}x} \\ 
 & \ \ \ \ \ \ \ \ \ \ \ =\frac{{{\ln }^{2}}\lambda }{\lambda }\cdot \frac{\pi -\theta }{\sin \theta }+\frac{4}{\lambda \sin \theta }\left( \frac{{{\pi }^{2}}\theta }{6}-\frac{\pi {{\theta }^{2}}}{4}+\frac{{{\theta }^{3}}}{12} \right) \\ 
\end{align}$$
Can anybody verify my result? Or perhaps show more method? :)
 A: Some food for thought that hopefully one of us will pursue in more detail soon.
The function $(1-2 x \cos{\theta} + x^2)^{-1}$ is a generating function for the Chebyshev polynomials of the second kind $U_n(\cos{\theta})$:
$$(1-2 x \cos{\theta} + x^2)^{-1} = \sum_{n=0}^{\infty} U_n(\cos{\theta}) x^n$$
So your integral is
$$\int_0^1 dx \: \frac{\ln ^2x}{1-2\cos \theta x+x^2} =  \sum_{n=0}^{\infty} U_n(\cos{\theta}) \int_0^1 dx \: x^n \, \log^2{x} $$
Now, I found this very interesting:  It turns out that
$$\int_0^1 dx \: x^n \, \log^2{x} = \frac{2}{(n+1)^3} $$
The integral becomes
$$\int_0^1 dx \: \frac{\ln ^2x}{1-2\cos \theta x+x^2} =  2\sum_{n=0}^{\infty} \frac{U_n(\cos{\theta})}{(n+1)^3}$$
EDIT
I will derive the result for the integral above.  Integrate by parts, as I indicated:
$$\begin{align}\int_0^1 dx \: x^n \, \log^2{x} &= \underbrace{[x^{n+1} \log{x} (\log{x} - 1)]_0^1}_{0} - \int_0^1 dx \: x (\log{x} - 1) \frac{d}{dx} [x^n \log{x}]\\ &= -\int_0^1 dx \: x^n (\log{x} - 1) (1+n \log{x})\\ &= -n \int_0^1 dx \: x^n \, \log^2{x} + (n-1) \int_0^1 dx \: x^n \, \log{x} + \int_0^1 dx \: x^n \\\end{align}$$
so that
$$\begin{align} (n+1)\int_0^1 dx \: x^n \, \log^2{x} &= \frac{1}{n+1} - \frac{n-1}{(n+1)^2} \\ &= \frac{2}{(n+1)^2} \\ \end{align}$$
The result follows from this.
EDIT$_2$
Well, in my hubris, I did not catch the defining relation of $U_n$:
$$U_n(\cos{\theta}) = \frac{\sin{[(n+1) \theta]}}{\sin{\theta}}$$
This reproduces the sum you evaluated above.
