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

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

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

But I don't know how to solve $\displaystyle 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!