In △BEG,
∠1=∠GBE+∠BGE
(Exterior angle property of a triangle)
⇒∠1=40∘+65∘
⇒∠1=105∘
Now, ∠2=∠BGE
(Since vertically opposite angles are equal)
⇒∠2=65∘
Similarly ∠GFC=∠AFD=90∘
Now, in △FGC
∠2+∠3+90∘=180∘
⇒∠3=180∘−90∘−65∘
⇒∠3=25∘
Now, in △AEC
x+∠1+∠3=180∘
⇒x+105∘+25∘=180∘
⇒x=180∘−(105∘+25∘)
⇒x=50∘