To solve the integral \(\int \frac{2 x^{2}}{\left(4+x^{2}\right)^{2}} d x\) using the substitution \(x = 2 \tan \theta\), follow these steps:
- Substitute \(x = 2 \tan \theta\), which implies \(dx = 2 \sec^2 \theta \, d\theta\).
- Replace \(x\) and \(dx\) in the integral with the expressions in terms of \(\theta\).
- Simplify the integral using trigonometric identities.
- Integrate with respect to \(\theta\).
- Convert back to \(x\) using the inverse substitution \(\theta = \tan^{-1}(x/2)\).
We start with the integral
\[
\int \frac{2 x^{2}}{(4+x^{2})^{2}} \, dx
\]
Using the substitution \(x = 2 \tan \theta\), we find that
\[
dx = 2 \sec^2 \theta \, d\theta
\]
Substituting \(x\) and \(dx\) into the integral, we have:
\[
\int \frac{2 (2 \tan \theta)^{2}}{(4 + (2 \tan \theta)^{2})^{2}} \cdot 2 \sec^2 \theta \, d\theta
\]
This simplifies to:
\[
\int \frac{16 \tan^{2} \theta \sec^{2} \theta}{(4 \tan^{2} \theta + 4)^{2}} \, d\theta
\]
The expression simplifies further to:
\[
\int \sin^{2} \theta \, d\theta
\]
Integrating \(\sin^{2} \theta\) gives:
\[
\frac{\theta}{2} - \frac{\sin \theta \cos \theta}{2} + C
\]
Substituting back \(\theta = \tan^{-1} \left(\frac{x}{2}\right)\):
\[
\frac{1}{2} \tan^{-1} \left(\frac{x}{2}\right) - \frac{\sin \left(\tan^{-1} \left(\frac{x}{2}\right)\right) \cos \left(\tan^{-1} \left(\frac{x}{2}\right)\right)}{2} + C
\]
Using the identity \(\sin(\tan^{-1}(u)) = \frac{u}{\sqrt{1+u^2}}\) and \(\cos(\tan^{-1}(u)) = \frac{1}{\sqrt{1+u^2}}\), we find:
\[
\sin \left(\tan^{-1} \left(\frac{x}{2}\right)\right) = \frac{\frac{x}{2}}{\sqrt{1+\left(\frac{x}{2}\right)^{2}}} = \frac{x}{\sqrt{x^{2}+4}}
\]
\[
\cos \left(\tan^{-1} \left(\frac{x}{2}\right)\right) = \frac{2}{\sqrt{x^{2}+4}}
\]
Thus, the integral evaluates to:
\[
-\frac{x}{4 \left(\frac{x^{2}}{4} + 1\right)} + \frac{1}{2} \tan^{-1} \left(\frac{x}{2}\right) + C
\]
The final result of the indefinite integral is:
\[
\boxed{-\frac{x}{4 \left(\frac{x^{2}}{4} + 1\right)} + \frac{1}{2} \tan^{-1} \left(\frac{x}{2}\right) + C}
\]