Check the picture below.
the idea being, that if we run an altitude segment from a right-angle in a triangle, and parallel to the opposite side, like in thise case, we end up with 3 similar triangles, a Large one, containing the other smaller ones, a Medium and a Small.
now, let's simply use proportions for those similar triangles.
![\bf \stackrel{Large}{\cfrac{12}{4+x}}=\stackrel{Small}{\cfrac{4}{12}}\implies \cfrac{12}{4+x}=\cfrac{1}{3}\implies 36=4+x\implies \boxed{32=x} \\\\[-0.35em] ~\dotfill\\\\ \stackrel{Small}{\cfrac{4}{y}}=\stackrel{Medium}{\cfrac{y}{x}}\implies 4x=y^2\implies 4(32)=y^2\implies 128=y^2\implies \sqrt{128}=y \\\\\\ \sqrt{64\cdot 2}=y\implies \sqrt{8^2\cdot 2}=y\implies \boxed{8\sqrt{2}=y} \\\\[-0.35em] ~\dotfill](https://tex.z-dn.net/?f=%5Cbf%20%5Cstackrel%7BLarge%7D%7B%5Ccfrac%7B12%7D%7B4%2Bx%7D%7D%3D%5Cstackrel%7BSmall%7D%7B%5Ccfrac%7B4%7D%7B12%7D%7D%5Cimplies%20%5Ccfrac%7B12%7D%7B4%2Bx%7D%3D%5Ccfrac%7B1%7D%7B3%7D%5Cimplies%2036%3D4%2Bx%5Cimplies%20%5Cboxed%7B32%3Dx%7D%20%5C%5C%5C%5C%5B-0.35em%5D%20~%5Cdotfill%5C%5C%5C%5C%20%5Cstackrel%7BSmall%7D%7B%5Ccfrac%7B4%7D%7By%7D%7D%3D%5Cstackrel%7BMedium%7D%7B%5Ccfrac%7By%7D%7Bx%7D%7D%5Cimplies%204x%3Dy%5E2%5Cimplies%204%2832%29%3Dy%5E2%5Cimplies%20128%3Dy%5E2%5Cimplies%20%5Csqrt%7B128%7D%3Dy%20%5C%5C%5C%5C%5C%5C%20%5Csqrt%7B64%5Ccdot%202%7D%3Dy%5Cimplies%20%5Csqrt%7B8%5E2%5Ccdot%202%7D%3Dy%5Cimplies%20%5Cboxed%7B8%5Csqrt%7B2%7D%3Dy%7D%20%5C%5C%5C%5C%5B-0.35em%5D%20~%5Cdotfill)
