Showing $Cor(X,Y) = 1$ if $a>0$ and $-1$ if $a<0$ Suppose X and Y are random variables such that $Y=aX+b$ and $a$ and $b$ are constants. Show that $Cor(X,Y) = \begin{cases} +1 &amp;\mbox{if } a &gt; 0 \\
-1 &amp; \mbox{if } a &lt; 0. \end{cases}$

For this, I am using the formula for correlation provided in my book:

$$Cor(X,Y) = \frac{Cov(X,Y)}{\sqrt{Var(X)Var(Y)}}
= \frac{E(XY) - E(X)E(Y)}{\sqrt{(E(X^2) - E(X)^2)(E(Y^2) - E(Y)^2)}}$$. 

I substitute in the values of X and Y=aX+b to get:

$$Cor(X,aX+b) = \frac{E(X(aX+b)) - E(X)E(aX+b)}{\sqrt{(E(X^2) - E(X)^2)(E((aX+b)^2) - E(aX+b)^2)}}$$

I know that I can pull out constants and use the sum rule, but using those just gets really messy and I don't think leads anywhere. 

I know how to show this would be between -1 and 1, but I must show it is exactly -1 OR exactly 1. I assume that this would involve squaring this value, but I am lost with where to go from here. Anything I do just makes the equation monstrous. I have been told this is an "easy" proof.

Any tips on how to proceed?
Hint: Use the first part of your $Cor(X, Y)$ expression:
$$
Cor(X, Y)=\frac{Cov(X, Y)}{\sqrt{Var(X)Var(Y)}}
$$
and replace $Y$ by $Y=aX+b$. Use the rules for covariances and variances to simplify.
$$
Cor(X,aX+b) = \frac{E(X(aX+b)) - E(X)E(aX+b)}{\sqrt{(E(X^2) - E(X)^2)(E((aX+b)^2) - E(aX+b)^2)}}
$$

let $\mu = E(X) and \sigma^2 = E(X^2), 
then

$$
E(X(aX+b)) - E(X)E(aX+b) = E(aX^2+bX) - E(X)(aE(X) + b) = aE(X^2) + bE(X) - a(E^2(X)) - bE(X) = a(E(X^2) - aE^2(X)
$$

$$
(E(X^2) - E(X)^2)(E((aX+b)^2) - E(aX+b)^2) = (\sigma^2 - \mu^2)(E(a^2X^2+2abX+b^2) - (aE(X) + b)^2 = (\sigma^2 - \mu^2)((a^2\sigma^2 +2ab\mu + b^2) - (a^2\mu^2 +2ab\mu + b^2)) = (\sigma^2 - \mu^2)(a^2(\sigma^2 - \mu^2)) = (a((\sigma^2 - \mu^2))^2
$$