Know the original function, how to find the inverse function? For example: the original function is y = (3x + 1) / (X-2), how to find the inverse function is y = (2x + 1) / (x-3)

Know the original function, how to find the inverse function? For example: the original function is y = (3x + 1) / (X-2), how to find the inverse function is y = (2x + 1) / (x-3)

y = (3x + 1)/(x - 2)
xy - 2y = 3x + 1
yx - 3x = 1 + 2y
(y - 3)x = 2y + 1
x = (2y + 1)/(y - 3)
Exchange x, Y: y = (2x + 1) / (x - 3)