$$(5-\sqrt2)(5+\sqrt2)=5^2-\left(\sqrt2\right)^2=25-2=23$$
But as some general rule of mathematics, if a rational number is added or subtracted from or to an irrational number the result is an irrational number but in above example there's something wrong
As per rules $(5-\sqrt2)$ and $(5+\sqrt2)$, both would be irrational and if we multiply both these irrational terms we get an irrational number which do not match to our result $23$.
How's that possible??
Yes, if a rational number is added or subtracted from or to an irrational number the result is an irrational number.
But if you multiply 2 irrational numbers the result isn't always irrational!
For example: $\sqrt{3}*\sqrt{3}=\sqrt{9}=3 $ and $3\in \Bbb{R}$.