Find the number of distinct real roots of the following equation $x^2 +\frac{9x^2}{(x + 3)^2} = 40$.

A. $0$ B. $1$ C. $2$ D. $3$ E. $4$
1. Start with the given equation:
   \[
   x^2 + \frac{9x^2}{(x + 3)^2} = 40
   \]

2. Simplify the fraction:
   \[
   \frac{9x^2}{(x + 3)^2} = \frac{9x^2}{x^2 + 6x + 9}
   \]

3. Substitute back into the equation:
   \[
   x^2 + \frac{9x^2}{x^2 + 6x + 9} = 40
   \]

4. Let \( y = x + 3 \), then \( x = y - 3 \). Substitute \( x = y - 3 \) into the equation:
   \[
   (y - 3)^2 + \frac{9(y - 3)^2}{y^2} = 40
   \]

5. Simplify the equation:
   \[
   (y - 3)^2 + \frac{9(y - 3)^2}{y^2} = 40
   \]
   \[
   (y - 3)^2 \left(1 + \frac{9}{y^2}\right) = 40
   \]

6. Let \( z = y - 3 \), then the equation becomes:
   \[
   z^2 \left(1 + \frac{9}{(z + 3)^2}\right) = 40
   \]

7. Simplify further:
   \[
   z^2 + \frac{9z^2}{(z + 3)^2} = 40
   \]

8. Multiply through by \((z + 3)^2\) to clear the fraction:
   \[
   z^2(z + 3)^2 + 9z^2 = 40(z + 3)^2
   \]
   \[
   z^4 + 6z^3 + 9z^2 + 9z^2 = 40z^2 + 240z + 360
   \]
   \[
   z^4 + 6z^3 + 18z^2 = 40z^2 + 240z + 360
   \]
   \[
   z^4 + 6z^3 - 22z^2 - 240z - 360 = 0
   \]

9. This is a quartic equation, which can have up to 4 real or complex roots. To determine the number of real roots, we can use the Descartes' Rule of Signs or numerical methods.

10. By analyzing the polynomial or using a graphing tool, we find that the quartic equation has 2 real roots.

The final answer is \(\boxed{2}\).