TITLE: Finding a General Pattern for the Partial fraction of $\frac{1}{{{\left( 1+x \right)}^{n}}\left( 1+{{x}^{2}} \right)}$
QUESTION [8 upvotes]: I am interested in finding the general pattern for the partial fraction of:
$$
\frac{1}{{{\left( 1+x \right)}^{n}}\left( 1+{{x}^{2}} \right)}
$$ 
where $n=1,2,3,......$
here is the partial fractions from $n=1\quad to\quad 10$
$$
\left( \begin{matrix}
   1 & \frac{1-u}{2\left( {{u}^{2}}+1 \right)}+\frac{1}{2(u+1)}  \\
   2 & -\frac{u}{2\left( {{u}^{2}}+1 \right)}+\frac{1}{2(u+1)}+\frac{1}{2{{(u+1)}^{2}}}  \\
   3 & \frac{-u-1}{4\left( {{u}^{2}}+1 \right)}+\frac{1}{4(u+1)}+\frac{1}{2{{(u+1)}^{2}}}+\frac{1}{2{{(u+1)}^{3}}}  \\
   4 & \frac{1}{2{{(u+1)}^{3}}}+\frac{1}{2{{(u+1)}^{4}}}-\frac{1}{4\left( {{u}^{2}}+1 \right)}+\frac{1}{4{{(u+1)}^{2}}}  \\
   5 & \frac{u-1}{8\left( {{u}^{2}}+1 \right)}-\frac{1}{8(u+1)}+\frac{1}{4{{(u+1)}^{3}}}+\frac{1}{2{{(u+1)}^{4}}}+\frac{1}{2{{(u+1)}^{5}}}  \\
   6 & \frac{u}{8\left( {{u}^{2}}+1 \right)}-\frac{1}{8(u+1)}-\frac{1}{8{{(u+1)}^{2}}}+\frac{1}{4{{(u+1)}^{4}}}+\frac{1}{2{{(u+1)}^{5}}}+\frac{1}{2{{(u+1)}^{6}}}  \\
   7 & \frac{u+1}{16\left( {{u}^{2}}+1 \right)}-\frac{1}{16(u+1)}-\frac{1}{8{{(u+1)}^{2}}}-\frac{1}{8{{(u+1)}^{3}}}+\frac{1}{4{{(u+1)}^{5}}}+\frac{1}{2{{(u+1)}^{6}}}+\frac{1}{2{{(u+1)}^{7}}}  \\
   8 & -\frac{1}{8{{(u+1)}^{3}}}-\frac{1}{8{{(u+1)}^{4}}}+\frac{1}{4{{(u+1)}^{6}}}+\frac{1}{2{{(u+1)}^{7}}}+\frac{1}{2{{(u+1)}^{8}}}+\frac{1}{16\left( {{u}^{2}}+1 \right)}-\frac{1}{16{{(u+1)}^{2}}}  \\
   9 & \frac{1-u}{32\left( {{u}^{2}}+1 \right)}+\frac{1}{32(u+1)}-\frac{1}{16{{(u+1)}^{3}}}-\frac{1}{8{{(u+1)}^{4}}}-\frac{1}{8{{(u+1)}^{5}}}+\frac{1}{4{{(u+1)}^{7}}}+\frac{1}{2{{(u+1)}^{8}}}+\frac{1}{2{{(u+1)}^{9}}}  \\
   10 & -\frac{u}{32\left( {{u}^{2}}+1 \right)}+\frac{1}{32(u+1)}+\frac{1}{32{{(u+1)}^{2}}}-\frac{1}{16{{(u+1)}^{4}}}-\frac{1}{8{{(u+1)}^{5}}}-\frac{1}{8{{(u+1)}^{6}}}+\frac{1}{4{{(u+1)}^{8}}}+\frac{1}{2{{(u+1)}^{9}}}+\frac{1}{2{{(u+1)}^{10}}}  \\
\end{matrix} \right)
$$
Can any body see the pattern if any, Can we write it as a sum??
Problem background:
I am trying to find a closed form for the integral:
$$\int{\frac{1}{{{\left( 1+x \right)}^{n}}\left( 1+{{x}^{2}} \right)}dx}$$

REPLY [6 votes]: Put
\begin{equation*}
 f(x)=\dfrac{1}{(1+x)^n(1+x^2)}.
\end{equation*}
Then the partial fraction of $f(x)$ has the form
\begin{equation*}
 f(x) =\dfrac{ax+b}{1+x^2} + \sum_{k=1}^{n}\dfrac{c_k}{(1+x)^{n+1-k}}\tag {1}
\end{equation*}
or
\begin{equation*}
 f(x) = \dfrac{d_1}{x+i}+\dfrac{d_2}{x-i}+\sum_{k=1}^{n}\dfrac{c_k}{(1+x)^{n+1-k}}
\end{equation*}
where
\begin{gather*}
d_1= \underset{x=-i}{\rm{res}}f(x) = \dfrac{1}{(1-i)^n(-2i)}=-\dfrac{e^{i\frac{n\pi}{4}}}{\sqrt{2}^{n}2i}\\[2ex]
d_2= \underset{x=i}{\rm{res}}f(x) = \dfrac{1}{(1+i)^n(2i)}=\dfrac{e^{-i\frac{n\pi}{4}}}{\sqrt{2}^{n}2i}.
\end{gather*}
However,
\begin{gather*}
a=d_1+d_2 =-\dfrac{\sin\left(\frac{n\pi}{4}\right)}{2^{\frac{n}{2}}}\\[2ex]
b=i(d_2-d_1)= \dfrac{\cos\left(\frac{n\pi}{4}\right)}{2^{\frac{n}{2}}}.
\end{gather*}
Furthermore
\begin{gather*}
 c_k = \underset{x=-1}{\rm{res}}(1+x)^{n-k}f(x)=
 \underset{x=-1}{\rm{res}}\dfrac{1}{(1+x)^k(1+x^2)}=\\[2ex]
 \left.\dfrac{1}{(k-1)!}\dfrac{d^{k-1}}{dx^{k-1}}\left(\dfrac{1}{2i}\left(\dfrac{1}{x-i}-\dfrac{1}{x+i}\right)\right)\right|_{x=-1} =\\[2ex] \dfrac{1}{2i(k-1)!}(-1)^{k-1}(k-1)!\left(\dfrac{1}{(-1-i)^{k}}-\dfrac{1}{(-1+i)^{k}}\right)=
 \dfrac{1}{2i}\left(\dfrac{1}{(1-i)^{k}}-\dfrac{1}{(1+i)^{k}}\right)=\\[2ex]
 \dfrac{1}{2i}\left(\dfrac{e^{i\frac{k\pi}{4}}}{\sqrt{2}^{k}}-\dfrac{e^{-i\frac{k\pi}{4}}}{\sqrt{2}^{k}}\right) = \dfrac{\sin\left(\frac{k\pi}{4}\right)}{2^{\frac{k}{2}}}
 \end{gather*}
 Now we know all coefficients in (1).