How to find the inverse function of function y = 3x / (3x + 1)? Why is the answer y = log3 [x / (1-x)],

How to find the inverse function of function y = 3x / (3x + 1)? Why is the answer y = log3 [x / (1-x)],

3 ^ X: represents the x power of 3
y=[3^x]/[(3^x)+1]
y[(3^x)+1]=3^x
y×(3^x)+y=3^x
(3^x)-y(3^x)=y
(1-y)(3^x)=y
3^x=y/(1-y)
x=log(2)[(y)/(1-y)]
Then the inverse function is y = log (3) [(x) / (1-x)]