Let $ x,y$ are  real numbers such that $x^2+2cosy=1$. Find the ranges of $x-cosy$.
1. Given the equation \( x^2 + 2 \cos y = 1 \), we start by analyzing the possible values of \( x \) and \( \cos y \). Since \( \cos y \) ranges from \(-1\) to \(1\), we have:
   \[
   -2 \leq 2 \cos y \leq 2
   \]
   Therefore, the equation \( x^2 + 2 \cos y = 1 \) implies:
   \[
   x^2 + 2 \cos y = 1 \implies x^2 \leq 3
   \]
   Hence, \( x \) must satisfy:
   \[
   -\sqrt{3} \leq x \leq \sqrt{3}
   \]

2. We need to find the range of \( A = x - \cos y \). To do this, we express \( \cos y \) in terms of \( x \):
   \[
   \cos y = \frac{1 - x^2}{2}
   \]
   Substituting this into \( A \):
   \[
   A = x - \cos y = x - \frac{1 - x^2}{2} = x - \frac{1}{2} + \frac{x^2}{2}
   \]
   Simplifying, we get:
   \[
   A = \frac{x^2}{2} + x - \frac{1}{2}
   \]

3. To find the range of \( A \), we analyze the expression \( A = \frac{x^2}{2} + x - \frac{1}{2} \) over the interval \( -\sqrt{3} \leq x \leq \sqrt{3} \).

4. Consider the function \( f(x) = \frac{x^2}{2} + x - \frac{1}{2} \). We need to find the minimum and maximum values of this function within the given interval.

5. First, we find the critical points by taking the derivative of \( f(x) \) and setting it to zero:
   \[
   f'(x) = x + 1
   \]
   Setting \( f'(x) = 0 \):
   \[
   x + 1 = 0 \implies x = -1
   \]

6. Evaluate \( f(x) \) at the critical point and the endpoints of the interval:
   \[
   f(-1) = \frac{(-1)^2}{2} + (-1) - \frac{1}{2} = \frac{1}{2} - 1 - \frac{1}{2} = -1
   \]
   \[
   f(\sqrt{3}) = \frac{(\sqrt{3})^2}{2} + \sqrt{3} - \frac{1}{2} = \frac{3}{2} + \sqrt{3} - \frac{1}{2} = 1 + \sqrt{3}
   \]
   \[
   f(-\sqrt{3}) = \frac{(-\sqrt{3})^2}{2} + (-\sqrt{3}) - \frac{1}{2} = \frac{3}{2} - \sqrt{3} - \frac{1}{2} = 1 - \sqrt{3}
   \]

7. The minimum value of \( A \) is \(-1\) and the maximum value of \( A \) is \(1 + \sqrt{3}\).

The final answer is \( \boxed{ [-1, 1 + \sqrt{3}] } \).