Step 1: Find the first and second derivatives of \( y \).
Given \( y = (\tan^{-1} x)^2 \), we differentiate \( y \) with respect to \( x \). Using the chain rule:
\[
\frac{dy}{dx} = 2 \tan^{-1}(x) \cdot \frac{d}{dx} \left( \tan^{-1}(x) \right)
\]
Since \( \frac{d}{dx} \left( \tan^{-1}(x) \right) = \frac{1}{1 + x^2} \), we get:
\[
\frac{dy}{dx} = 2 \tan^{-1}(x) \cdot \frac{1}{1 + x^2}
\]
Thus, \( y_1 = 2 \tan^{-1}(x) \cdot \frac{1}{1 + x^2} \).
Step 2: Find the second derivative of \( y \).
To find \( y_2 \), we differentiate \( y_1 \) again using the product rule:
\[
y_2 = \frac{d}{dx} \left[ 2 \tan^{-1}(x) \cdot \frac{1}{1 + x^2} \right]
\]
The product rule gives:
\[
y_2 = 2 \cdot \frac{1}{1 + x^2} \cdot \frac{d}{dx} \left( \tan^{-1}(x) \right) + 2 \tan^{-1}(x) \cdot \frac{d}{dx} \left( \frac{1}{1 + x^2} \right)
\]
Simplifying:
\[
y_2 = 2 \cdot \frac{1}{1 + x^2} \cdot \frac{1}{1 + x^2} - 2 \tan^{-1}(x) \cdot \frac{2x}{(1 + x^2)^2}
\]
Step 3: Proving the equation.
Using the derivatives \( y_1 \) and \( y_2 \), we can now prove the given equation:
\[
(x^2 + 1)^2 y_2 + 2x (x^2 + 1) y_1 = 2
\]