Such partial fraction decomposition is very easy using the Heaviside cover up method. As I show in that answer, the method generalizes to quadratic denominators. Let's apply it to your problem.
$$\dfrac{a}{x+1} + \dfrac{\color{#c00}b}{(x+1)^2} + \dfrac{cx+d}{x^2+1}\, =\, \dfrac{2x}{(x+1)^2(x^2+1)}\tag{E}$$
Scaling $\rm\,(E)\,$ by $\,(x+1)^2,\,$ then evaluating at its root $\,x = -1\,$ yields
$$\ \ \ \ \color{#c00}b\, =\, \dfrac{2x}{x^2+1}\:\!\Bigg|_{\:\!\large x\,=\,-1} =\, \color{#c00}{ -1}$$
Subtracting out this known summand leaves a fraction in partial form, so we are done:
$$\require{cancel}\!\!\! \dfrac{\color{#0a0}{2x}}{(x+1)^2(x^2+1)}\, -\, \dfrac{\!\!\!\!\!\color{#c00}{-1}}{(x+1)^2}\: =\: \dfrac{\cancel{\color{#0a0}{2x}+x^2+1}}{\cancel{(x+1)^2}(x^2+1)}\, =\, \dfrac{1}{x^2+1}\quad {\bf\small QED}$$
Remark $ $ It's unneeded - but instructive - to use this quadratic Heaviside method for all terms:
Scaling $\rm\,(E)\,$ by $\,x^2+1\,$ then evaluating at its root $\,x = i\,$ yields
$$ \color{#0a0}c\, i + \color{#c00}d\, =\, \dfrac{2i}{(i\!+\!1)^2} \, =\, \dfrac{2i}{2i} \,=\, \color{#c00}1\ \Rightarrow\ \color{#0a0}{c = 0},\ \color{#c00}{d = 1} $$
Scaling $\rm\,(E)\,$ by $\,(x\!+\!1)^2\,$ then evaluating at its root $\,x = w,\,$ so $\,\color{#c0d}{w^2\!+\!1 = -2w}$
$$a(w+1)+ b\, =\, \dfrac{2w}{\color{#c0d}{w^2\!+\!1}}\,=\,\dfrac{\ \ \,2w}{\color{#c0d}{-2w}} \,=\, -1\,\Rightarrow\ a=0,\ b=-1 $$
Below are some further examples asked about in comments.
$$ \dfrac{f}{(x+1)^2} + \dfrac{cx+d}{x^2+1}\, =\, \dfrac{2x+1}{(x+1)^2(x^2+1)}\tag{$\rm \dot E$}$$
Scaling $\rm\,(\dot E)\,$ by $\,(x\!+\!1)^2\,$ then evaluating at its root $\,x = w,\,$
$$f\, =\, \dfrac{\color{#0a0}{2w+1}}{\color{#c0d}{w^2\!+\!1}}\,=\,\dfrac{\color{#0a0}{-w^2}}{\color{#c0d}{-2w}} \,=\, \dfrac{w}2 $$
by $\,w^2\!+2w\!+\!1=0\ \Rightarrow\ \color{#0a0}{2w\!+\!1=-w^2},\,\ \color{#c0d}{w^2\!+\!1 = -2w}$
$$ \dfrac{f}{(x-2)^2} + \dfrac{c}{x-1}\, =\, \dfrac{x}{(x-2)^2(x-1)}\tag{$\rm \ddot E$}$$
Scaling $\rm\,(\ddot E)\,$ by $\,(x\!-\!2)^2\,$ then evaluating at its root $\,x = w,\,$
$$f\, =\, \dfrac{w}{\color{c0d}{w\!-\!1}}\,=\,1+\color{#c00}{\dfrac{1}{w\!-\!1}} = 4\!-\!w $$
$\!\underbrace{{\rm since\ we've }\,\ 0=(w\!-\!2)^2\! = (w\!-\!3)(w\!-\!1) + 1}_{\textstyle \text{polynomial}\ \color{darkorange}{\rm divide}\,\ (w\!-\!2)^2 \:\! \ {\rm by}\ \ (w\!-\!1)\qquad\ \ \ }\,\Rightarrow\, \color{#c00}{\dfrac{1}{w\!-\!1}= 3\!-\!w}$
OR $\bmod w\!-\!1\!:\ (w\!-\!2)^2 \equiv 1^2\,$ so $\,w\!-\!1\mid (w\!-\!2)^2\!\color{#c00}{-\!1^2} = \color{#c00}{(w\!-\!3)(w\!-\!1)}$
Generally given coprime polynomials $\,p,q\,$ over a field $K$ (e.g. $\Bbb Q, \Bbb R, \Bbb C),\,$ we can use the Euclidean algorithm to compute partial fraction decompositions as follows
$$\begin{align} \dfrac{f}p + \dfrac{g}q \,&=\, \dfrac{h}{pq}\\[.4em]
\iff\ q\:\!f + p\:\!g\, &=\, h\end{align}\qquad$$
We can solve the latter equation for $\,f,g\,$ using the same methods that we do for integers - by the (extended) Euclidean algorithm and closely related methods, e.g. evaluating it mod $p\,$ we deduce $\,qf\equiv h\iff f\equiv h/q\,\pmod{\!p},\,$ which is exactly the same as the Heaviside method above. $\ $ For linear $\,q\,$ we can compute $\,1/q\bmod p\,$ simply by (long hand) polynomial $\color{darkorange}{\text{dividing}}$ $\,p\,$ by $\,q\,$ (as we did in the final example above), which amounts to optimizing the case when the extended Euclidean algorithm terminates in a single step.
Similar ideas were employed by Hermite in general partial fraction decomposition algorithms used for integrating rational functions, e.g. see here.