Chord and diameter in circle Question:

In circle with radious $R$ we have diameter $AB$ and chord $CD$. The chord intersects $AB$ in point $M$ such that $\angle CMB = 45^o$. Show that $CM^2 + DM^2 = 2R^2$.

My attempt:
I'm sure there is nice solution, but all I can get to are some awful calucations. I know that $CM \cdot DM = AM \cdot BM$, but I'm not sure it will be any help. 
Thanks for hints/solutions in advance.
 A: Hint: Perpendicular bisector of chord passes through centre
Let $CM = a, DM = b  $
$AM=x, BM = 2R -x$  
$x(2R-x) = ab $
and $(\frac{(a-b)}{2})^2 + (\frac{(a-b)}{2})^2 = (R-x)^2$
(Pythagoras theorem in triangle $OPM$, $O$ is centre, $P$ is midpoint of chord $CD)$  
From these two equations you will get $a^2 + b^2 = 2R^2$
A: Maybe an algebraic argument could also be of some use.
We first show that $CM^2 + MD^2$ equals a constant wherever the chord $CD$ is placed, and then easily find the constant by considering the comy case when $CD$ is a diameter.
In a cartesian system centered at the centre of the circumference, points $C$ and $D$ are given by the intersection of the circumference
$$ x^2 + y^2 = R^2$$ and the line $$ y = x -d$$ where $d = \vert AM \vert$
One gets the quadratic equation $$ x^2 + (x-d)^2 = R^2$$ From here one can conclude immediately that $x_1^2 + x_2^2 = constant$: of course one could also perform a direct calculation check, by finding the roots $$x_{1,2} = \frac{2d \pm \sqrt{4d^2 - 8(d^2 - R^2)}}{4} $$
and verifying that $$x_1^2 + x_2^2$$ yield and expression where  all the terms containing $d$ cancel out.
$x_1^2 + x_2^2 = constant$ and $y_1$ and $y_2$ are determined by triangles similitude, even without calcualting the latter it is possible to conclude $$ CM^2 + DM^2 = constant_1$$  and we can find the value of the constant by convenienty looking at the case $M=O$, i.e. when the cord $CD$ is a diameter too.
It follows then trivially $$CM^2 + DM^2 = 2R^2 $$
