Let $f(x)=\int_0^ x \frac{1}{1+t^2}dt.$ For $-1\leq x<1$, find $\cos \left\{2f\left(\sqrt{\frac{1+x}{1-x}}\right)\right\}.$

[i]2011 Ritsumeikan University entrance exam/Science and Technology[/i]
1. Given the function \( f(x) = \int_0^x \frac{1}{1+t^2} \, dt \), we recognize that the integrand is the derivative of the inverse tangent function. Therefore, we have:
   \[
   f(x) = \tan^{-1}(x)
   \]

2. We need to find \( \cos \left\{ 2f\left( \sqrt{\frac{1+x}{1-x}} \right) \right\} \). Substituting \( f(x) \) into the expression, we get:
   \[
   \cos \left( 2f\left( \sqrt{\frac{1+x}{1-x}} \right) \right) = \cos \left( 2 \tan^{-1} \left( \sqrt{\frac{1+x}{1-x}} \right) \right)
   \]

3. We use the double-angle formula for cosine, which states:
   \[
   \cos(2\theta) = \frac{1 - \tan^2(\theta)}{1 + \tan^2(\theta)}
   \]
   Here, \(\theta = \tan^{-1} \left( \sqrt{\frac{1+x}{1-x}} \right)\). Therefore:
   \[
   \cos \left( 2 \tan^{-1} \left( \sqrt{\frac{1+x}{1-x}} \right) \right) = \frac{1 - \tan^2 \left( \tan^{-1} \left( \sqrt{\frac{1+x}{1-x}} \right) \right)}{1 + \tan^2 \left( \tan^{-1} \left( \sqrt{\frac{1+x}{1-x}} \right) \right)}
   \]

4. Since \(\tan(\tan^{-1}(y)) = y\), we have:
   \[
   \tan \left( \tan^{-1} \left( \sqrt{\frac{1+x}{1-x}} \right) \right) = \sqrt{\frac{1+x}{1-x}}
   \]
   Thus:
   \[
   \tan^2 \left( \tan^{-1} \left( \sqrt{\frac{1+x}{1-x}} \right) \right) = \left( \sqrt{\frac{1+x}{1-x}} \right)^2 = \frac{1+x}{1-x}
   \]

5. Substituting this back into the double-angle formula, we get:
   \[
   \cos \left( 2 \tan^{-1} \left( \sqrt{\frac{1+x}{1-x}} \right) \right) = \frac{1 - \frac{1+x}{1-x}}{1 + \frac{1+x}{1-x}}
   \]

6. Simplifying the numerator and the denominator:
   \[
   1 - \frac{1+x}{1-x} = \frac{(1-x) - (1+x)}{1-x} = \frac{1-x-1-x}{1-x} = \frac{-2x}{1-x}
   \]
   \[
   1 + \frac{1+x}{1-x} = \frac{(1-x) + (1+x)}{1-x} = \frac{1-x+1+x}{1-x} = \frac{2}{1-x}
   \]

7. Therefore:
   \[
   \cos \left( 2 \tan^{-1} \left( \sqrt{\frac{1+x}{1-x}} \right) \right) = \frac{\frac{-2x}{1-x}}{\frac{2}{1-x}} = -x
   \]

The final answer is \(\boxed{-x}\).