Triangle $BCD$ is isosceles, as $BC=BD$. Therefore, $\angle BCD = \angle BDC = 65^\circ$.

Angles in a triangle add up to $180^\circ$, so applying this in $BCD$ gives:

$\angle CBD = 180^\circ - \angle BCD - \angle BDC = 180^\circ - 65^\circ - 65^\circ = 50^\circ$.

$\angle CBD$ and $\angle ABE$ are opposite angles at $B$, so are equal. Therefore $\angle ABE = 50^\circ$.

Since the angles in triangle $ABE$ add up to $180^\circ$, $x = 180^\circ - \angle BEA - \angle ABE = 180^\circ - 90^\circ - 50^\circ = 40^\circ$.

This problem is taken from the UKMT Mathematical Challenges.

You can find more short problems, arranged by curriculum topic, in our short problems collection.