the number is xy
x+y=12
10y+x=54+10x+y
so
x+y=12
minus x both sides
y=12-x
sub that for y
10(12-x)+x=54+10x+(12-x)
120-10x+x=54+10x+12-x
120-9x=66+9x
add 9x both sides
120=66+18x
minus 66 both sides
54=18x
divide both sides by 18
3=x
sub back
y=12-x
y=12-3
y=9
the number is 39