solve $\frac{\sqrt{5}(\cos \theta - \sin \theta)}{3\sqrt{2}}=\tan \theta$ I came across a question from another forum -
find the $x$ in the following diagram:

I managed to deduce an equation from the following diagram:

which is:
$\dfrac{\sqrt{5}(\cos \theta - \sin \theta)}{3\sqrt{2}}=\tan \theta$
and I know the answer (from WolframAlpha) is:
$\cos \theta= \dfrac{3}{\sqrt{10}}$
but I'm not able to deduce the answer myself, any ideas?
By the way, $x=2\sqrt{5}$, which can be easily deduced by:
$\dfrac{3\sqrt{2}}{x}=\cos\theta$
I also tried to solve the original question geometrically:

Somehow, I managed to figure out that $y=3$ in the above diagram, but I can't prove it either.

If we start with this diagram:

we can deduce that:
$$
\overline{CE}=\sqrt{(k+1)^2+1}
\\
\overline{DE}=\frac{1}{k+1}\sqrt{(k+1)^2+1}
\\
\frac{\overline{DE}}{\overline{BC}}
=\frac{\frac{1}{k+1}\sqrt{(k+1)^2+1}}{k}
=\frac{\sqrt{(k+1)^2+1}}{k(k+1)}
=\frac{\sqrt{5}}{3\sqrt{2}}
\\
5k^2(k+1)^2=18(k+1)^2+18
\\
5k^4+10k^3-13k^2-36k-36=0
\\
(k-2)(5k^3+20k^2+27k+18)=0
$$
hence we have only one positive solution $k=2$.
Now we can deduce any segment length on the diagram from this solution.
