Given: \[ I(x) = \int \frac{6}{\sin^2 x (1 - \cot x)^2} \, dx. \]
Step 1: Substitution Let: \[ t = 1 - \cot x, \quad \csc^2 x \, dx = dt. \] The integral becomes: \[ I = \int \frac{6 \, dt}{t^2} = -\frac{6}{t} + c = -\frac{6}{1 - \cot x} + c. \]
Step 2: Using \(I(0) = 3\): At \(x = 0\), \(\cot(0) = \infty\). Substituting: \[ I(0) = 3 = -\frac{6}{1 - \cot(0)} + c \implies c = 3. \] Thus, the expression for \(I(x)\) becomes: \[ I(x) = 3 - \frac{6}{1 - \cot x}. \]
Step 3: Evaluate \(I\left(\frac{\pi}{12}\right)\): At \(x = \frac{\pi}{12}\): \[ \cot\left(\frac{\pi}{12}\right) = 2 + \sqrt{3}. \] Substitute into \(I(x)\): \[ I\left(\frac{\pi}{12}\right) = 3 - \frac{6}{1 - (2 + \sqrt{3})}. \] Simplify: \[ I\left(\frac{\pi}{12}\right) = 3 + \frac{6}{2 + \sqrt{3} - 1} = 3 + \frac{6}{1 + \sqrt{3}}. \]
Step 4: Rationalize the denominator: \[ \frac{6}{1 + \sqrt{3}} = \frac{6(1 - \sqrt{3})}{(1 + \sqrt{3})(1 - \sqrt{3})} = \frac{6(1 - \sqrt{3})}{1 - 3} = \frac{6(\sqrt{3} - 1)}{2} = 3(\sqrt{3} - 1). \] Substitute back: \[ I\left(\frac{\pi}{12}\right) = 3 + 3\sqrt{3} - 3 = 3\sqrt{3}. \]
Final Answer: \[ \boxed{3\sqrt{3}.} \]