<s>[INST] Seeking methods to solve: $\int_0^\infty \frac{\ln(t)}{t^n + 1}\:dt$ Seeking Methods to solve the following two definite integrals:
\begin{equation}
I_(n) = \int_0^\infty \frac{\ln(t)}{t^n + 1}\:dt \qquad J(n) = \int_0^\infty \frac{\ln^2(t)}{t^n + 1}\:dt
\end{equation}
For $n \in \mathbb{R},\:n \gt 1$
The method I took was to take the following integral:
\begin{equation}
 \int_0^\infty \frac{t^k}{\left(t^n + 1\right)^m}\:dt = \frac{1}{n}B\left(m - \frac{k + 1}{n}, \frac{k + 1}{n} \right)
\end{equation}
Where: $0 \leq k \lt n$. Here let $m = 1$.
Differentiate under the curve with respect to $k$ and taking the limit as $k \rightarrow 0^+$ (via the Dominated Convergence Theorem), i.e. 
\begin{align}
\lim_{k \rightarrow 0+} \frac{d}{dk} \left[ \int_0^\infty \frac{t^k}{t^n + 1}\:dt \right] &= \lim_{k \rightarrow 0+} \frac{d}{dk} \left[\frac{1}{n}B\left(1 - \frac{k + 1}{n}, \frac{k + 1}{n} \right) \right] \\
\lim_{k \rightarrow 0+}  \int_0^\infty \frac{t^k \ln(t)}{t^n + 1}\:dt  &= \lim_{k \rightarrow 0+}  \left[\frac{1}{n^2} B\left(1 - \frac{k + 1}{n}, \frac{k + 1}{n}\right)\left[\psi^{(0)}\left(\frac{k + 1}{n} \right) - \psi^{(0)}\left(1 - \frac{k + 1}{n} \right)\right] \right] \\
\int_0^\infty \frac{\ln(t)}{t^n + 1}\:dt&= \frac{1}{n^2} B\left(1 - \frac{1}{n}, \frac{1}{n}\right)\left[\psi^{(0)}\left(\frac{1}{n} \right) - \psi^{(0)}\left(1 - \frac{1}{n} \right)\right] \\
&=- \frac{\pi^2}{n^2}\operatorname{cosec}\left(\frac{\pi}{n}\right)\cot\left(\frac{\pi}{n} \right)
\end{align}
Which is our expression for $I_n$. Taking the same approach but differentiating twice with respect to $k$ we arrive at our expression for $J_n$:
\begin{equation}
 J(n) = \int_0^\infty \frac{\ln^2(t)}{t^n + 1}\:dt = \frac{\pi^3}{n^3}\operatorname{cosec}\left(\frac{\pi}{n} \right)\left[\operatorname{cosec}^2\left(\frac{\pi}{n}\right) + \cot^2\left(\frac{\pi}{n}\right) \right]
\end{equation}
And in fact we may generalise:
\begin{equation}
    \int_0^\infty \frac{\ln^p(t)}{\left(t^n + 1\right)^m}\:dt = \lim_{k\rightarrow 0}\frac{d^p}{dk^p}\left[\frac{1}{n} B\left(m - \frac{k + 1}{n}, \frac{k + 1}{n}\right)\right]
\end{equation}
Where $p \in \mathbb{N}$
This method however was just an extension of another integral. I'm curious, if I had just started with $I_n, J_n$ what alternative methods could be used?
 [/INST] You can use the pole expansions
\begin{align}
\csc^2 (z) &= \sum_{m \in \mathbb{Z}} \frac{1}{[m \pi + z]^2} \, , \, z \in \mathbb{C}\setminus\pi\mathbb{Z} \, , \\
\sec^2 (z) &= \sum_{m \in \mathbb{Z}} \frac{1}{\left[\left(m+\frac{1}{2}\right) \pi + z\right]^2} \, , \, z \in \mathbb{C}\setminus\pi \left(\mathbb{Z} + \frac{1}{2}\right) \, , 
\end{align}
and their derivatives to find the integrals. We have
\begin{align}
-I_n &= \int \limits_0^\infty \frac{-\ln(t)}{1+t^n} \, \mathrm{d}t = \int \limits_0^1 [-\ln(t)] \frac{1-t^{n-2}}{1+t^n} \, \mathrm{d} t = \sum \limits_{k=0}^\infty (-1)^k \int\limits_0^1 [-\ln(t)] (1-t^{n-2})t^{n k} \, \mathrm{d} t \\
&= \sum \limits_{k=0}^\infty (-1)^k \left[\frac{1}{(nk+1)^2} - \frac{1}{(n k + n - 2 
 + 1)^2}\right] = \sum \limits_{k=0}^\infty (-1)^k \left[\frac{1}{(nk+1)^2} - \frac{1}{(n(k+1)-1)^2}\right] \\
&= \frac{\pi^2}{4 n^2} \sum \limits_{l=0}^\infty \left[\frac{1}{\left(l \pi + \frac{\pi}{2n}\right)^2} - \frac{1}{\left(\left(l+\frac{1}{2}\right) \pi + \frac{\pi}{2n}\right)^2}  + \frac{1}{\left((l+1) \pi - \frac{\pi}{2n}\right)^2} - \frac{1}{\left(\left(l+\frac{1}{2}\right) \pi - \frac{\pi}{2n}\right)^2}\right] \\
&= \frac{\pi^2}{4 n^2} \sum_{m \in \mathbb{Z}} \left[\frac{1}{\left(m \pi + \frac{\pi}{2n}\right)^2} - \frac{1}{\left(\left(m+\frac{1}{2}\right) \pi + \frac{\pi}{2n}\right)^2}  \right] = \frac{\pi^2}{4n^2} \left[\csc^2 \left(\frac{\pi}{2n}\right) - \sec^2 \left(\frac{\pi}{2n}\right)\right] \\
&= \frac{\pi^2}{n^2} \frac{\cos\left(\frac{\pi}{n}\right)}{\sin^2\left(\frac{\pi}{n}\right)}
\end{align}
and, similarly,
\begin{align}
J_n &= \int \limits_0^1 \ln^2(t) \frac{1+t^{n-2}}{1+t^n} \, \mathrm{d} t = 2 \sum \limits_{k=0}^\infty (-1)^k \left[\frac{1}{(nk+1)^3} + \frac{1}{(n(k+1)-1)^3}\right] \\
&= \frac{\pi^3}{4 n^3} \sum_{m \in \mathbb{Z}} \left[\frac{1}{\left(m \pi + \frac{\pi}{2n}\right)^3} - \frac{1}{\left(\left(m+\frac{1}{2}\right) \pi + \frac{\pi}{2n}\right)^3}\right] \\
&= \frac{\pi^3}{4 n^3} \left[\csc^2 \left(\frac{\pi}{2n}\right) \cot \left(\frac{\pi}{2n}\right) + \sec^2 \left(\frac{\pi}{2n}\right) \tan \left(\frac{\pi}{2n}\right)\right] \\
&= \frac{\pi^3}{n^3} \frac{1+\cos^2 \left(\frac{\pi}{n}\right)}{\sin^3 \left(\frac{\pi}{n}\right)}
\end{align}
for $n > 1$ .
</s>