# Reformulating objective function of canonical correlation analysis

Given two column vectors $X = (x_1, \dots, x_n)'$ and $Y = (y_1, \dots, y_m)'$ of random variables with finite second moments, canonical-correlation analysis seeks vectors $a$ and $b$ such that the random variables $a' X$ and $b' Y$ maximize the correlation $\rho = \operatorname{corr}(a' X, b' Y) = \displaystyle\frac{a' \Sigma _{XY} b}{\sqrt{a' \Sigma _{XX} a} \sqrt{b' \Sigma _{YY} b}}$.

(Wikipedia)

Now, at times, I see this written into the form

$max \ a' \Sigma _{XY} b \\ s.t.\ a' \Sigma_{XX} a = b' \Sigma_{YY} b = 1$

I do see that scaling $a$ or $b$ with any scalar has no effect in the first equation, but how do I get to the second equation?