Spearman's correlation between two variables, when one is a linear function of the other According to Spearman's rank correlation (denoted henceforth as $\rho$), given two variables $X,Y$, when each of them is a perfect monotone function of the other, we should expect it to be either $1$ - when $Y$ ascends as $X$ ascends, or $-1$ - when $Y$ descends as $X$ ascends.
What needs to happen in order to guarantee to get $\rho=0$?  
Let be more explicit about what I mean.
I was assigned to determine the following:
Given two variables $X,Y$, where $X=x_1,x_2,...,x_n$ , and $Y=aX+b$, I need to determine what $\rho$ to expect.  
$\rho$ is defined as:
$$\rho=1-\frac{6\sum_{i=1}^n(R_{x_i}-R_{y_i})^2}{n(n^2-1)}$$
Where $R_{x_i}$ is the rank of $x_i$ in $X$.
Suppose $a>0$, then $Y$ is a monotonic linear function of $X$, where $\forall x_{i_1},x_{i_2}\in X$, if $x_{i_1}<x_{i_2}$ then $ax_{i_1}+b<ax_{i_2}+b$, therefore, forall $i$; $R_{x_i}=R_{y_i}$, thus (plug it in above, and) $\rho=1$.  
Suppose $a<0$ then $Y$ is a monotonic linear function of $X$, where $\forall x_{i_1},x_{i_2}\in X$, if $x_{i_1}<x_{i_2}$ then $ax_{i_1}+b>ax_{i_2}+b$, therefore; $\sum(R_{x_i}-R_{y_i})^2$ is maximal. I showed that it is maximal when it is $\frac{n(n^2-1)}{3}$ ,thus (plug it in above, and) $\rho=-1$.
What happens when $a=0$? In this case, obviously there is no correlation whatsoever between $X$ and $Y$, but does the fact that $X=x_1,x_2,...,x_n$ and $Y=b,b,...,b$  necessarily means $\rho=0$? I think not. 
I think that in the case where $a=0$, there is no way to say anything about $\rho$ (besides "it will probably be very close to 0"), but I'm not really sure...
 A: If $a=0$, then the correlation between $x$ and $y = ax + b$ is not
defined. 
Computation of Pearson's correlation, would involve
division by 0.
In the computation of Spearman's correlation, all values of $y$
are equal, and there is no meaningful way to rank the $y$s.
[Note: You give one formula for Spearman's correlation. Another
valid computation is to reduce each variable to ranks and
find Pearson's correlation of the ranked variables. In this
sense, the difficulty with Spearman's method, when one
variable is constant, is also division
by 0.]
With either method, the correlation is either -1 or +1 if
there is an exact linear relationship with a < 0 or a > 0, respectively.
Below is a brief session in R statistical software that
illustrates some basic properties. Notice that both variables
x and y are are strictly increasing sequences, but the
relationship is nonlinear.
 x
 ##  1  2  3  4  5  6  7  8  9 10
 y
 ##   1   2   3   5   7  10  20  50 100 300
 rx = rank(x);  rx
 ##  1  2  3  4  5  6  7  8  9 10
 ry = rank(y);  ry
 ##  1  2  3  4  5  6  7  8  9 10
 cor(x, y)  # Pearson, nonlinear association 
 ## 0.7200748
 cor(x, y, method="spearman")
 ## 1
 cor(rx, ry) # Pearson r on ranked data is Spearman's r
 ## 1

