These are not the same thing, because Kotlin is statically typed language.
In the first case, you declare the variable result as Int, because x*2 is of Int type, as far as x is of Int type. And later try to assign a String value to it. Of course, this causes a type mismatch exception.
In the second case, you declare the variable as String from the very beginning, and assign a String to it latet. Everything is fine here. No error occurs.