First I marked this as ABCD triangle for the easy access.
Then ABC triangle was considered and according to the pythagorus relationship X was found.
Then according to the ACD triangle, and ABD triangles the following equations were taken.
According to the 3rd photo the answer is taken