There seems to be a problem with your question - AEC does not create a triangle while ADE does.
As for finding x
Draw an imaginary line from C to D. 3^2+4^2=5^2, so take the square root to find CD=5. Now we know that CA is also 5. To find x, x^2+3^2=5^2, or x^2+9=25. Subtract 9 from both sides to get 16, and take the square root of both sides to get x=4.