Solution:We can divide the triangle into two right triangles. (Look at the image below.)
By the Pythagorean Theorem we get the equations
$\left( \sqrt{2}\right)^{2}=x^{2}+a^{2}$
$\left( \sqrt{5}\right)^{2}=y^{2}+a^{2}$
And we know that $x + y = 3$
Now
$\left( \sqrt{2}\right)^{2} -x^{2} =a^{2}$
$\left( \sqrt{5}\right)^{2}- y^{2}=a^{2}$
So $\left( \sqrt{2}\right)^{2} -x^{2} = \left( \sqrt{5}\right)^{2}- y^{2}$
We get 2 simultaneous equations:
$\left\{
\begin{array}{c}
2-x^{2}=5-y^{2} \\
x+y=3
\end{array}
\right. $
After substituting $x=3-y$ into the first equation and get
$2-\left( 3-y\right)^{2}=5-y^{2}\Longrightarrow 2-9+6y-y^{2}=5-y^{2}$
So $6y=5+7\Longrightarrow y=2$
Since $5=y^{2}+a^{2}$
Then $a=\sqrt{5-y^{2}}=\sqrt{5-4}=1$