I have been struggling to find the inverse of this function:

f(x) = \frac{A \cdot x+B \cdot tanh^{-1}(C+D  \cdot  tanh(x))+P}{Q}=y

So I am looking for f^{-1}(y) = ... where all capital letters in f(x) represent constants!

But I don't know how to solve f(x) = y in terms of "x".

However I would also like to ask if it is correct to differentiate f(x) w.r.t. x to find f'(x) and invert that expression and integrate the result! It seems to me that this is not the right approach, because I tried it on a "simpler" function g(x)=x+sin(x) and it didn't produce the correct inverse function. But maybe I can get more "mileage" out of this approach.

Otherwise I don't know how to tackle this!
Any help is greatly appreciated!