Let $f(xy) = f(x)+ f(y) +\frac{x+y-1}{xy} \forall x,y>0$, $f'(1)=2$, $f$ is differentiable . Find $f(x)$. What I have gotten from $f(xy) = f(x)+ f(y) +\frac{x+y-1}{xy}$ is:

*

*$f(1)=-1$
2.$f(x)+f(\frac{1}{x}) =-(x+\frac{1}{x})$
The information I could get from $f'(1)=2$ is just:
$\lim_{h\to 0} { \frac{f(1+h)+1}{h}}=2$
Since the limit is given, my approach was to find $f'(x)$ and then solve the differential equation. But I'm unable to compute the limit $\lim_{h \to 0} {\frac{f(x+h)-f(x)}{h}}$ with the information given. I have tried stuff like converting $f(x)$ to $f(\frac{x}{h}\cdot h)$ and try to use the original equation and convert it into$ f(\frac{x}{h})+ f(h) +\frac{\frac{x}{h}+h-1}{x}$.But it hasn't been of any use to compute the limit. I need to do it in the way of computing the limit and solving the Differential equation.
 A: The functional equation can be rewritten:
$$f(xy)+\frac1{xy}=f(x)+\frac1x+f(y)+\frac1y.$$
So if $g(x)=f(x)+\frac1x,$ we have $$g(xy)=g(x)+g(y)$$ or $g(x)=C\log |x|$ for some constant $C.$
Then you want $f(x)=C\log |x|-\frac1x.$ Then use the fact that $f'(1)=2$ to determine $C.$

At heart, there is one "obvious" solution, and any other (continuous) solution must differ by a logarithm.
In general, if the functional equation was:
$$f(xy)=f(x)+f(y)+H(x,y)$$ for some function continuous $H,$ and $f_0$ is one continuous solution, then every continuous solution is of the form: $$f(x)=f_0(x)+C\log |x|$$ for some constant $C.$
A: Calculate the derivative with respect to $y$ let's say (for fixed $x>0$), that is $$ xf'(xy) = f'(y) - \frac{1}{y^2} + \frac{1}{xy^2} = f'(y) + \frac{1}{y^2}\left(\frac{1}{x}-1\right).$$
Let $y=1$, to get that for any $x>0$ $$ xf'(x) = f'(1) + 1(\frac{1}{x}-1) = 2 + \frac{1}{x} - 1 = \frac{1}{x}+1,$$ or equivalently (due to $x>0$) you get $f'(x) = \frac{1+x}{x^2}.$ You can easily find the general solution (by separation of the variables method) to get $f(x) = c - \frac{1}{x} + \ln(x)$ for some $c \in \mathbb R$. To get the precise value of $c$, plug the formula of $f$ into your equation. After calculations you should get $c=0$, i.e. $f(x) = \ln(x) -\frac{1}{x}$ for any $x>0$.
A: Here is an answer along the lines requested by OP by taking a limit.
I assume the domain is $x > 0 $
I use an alternate, but equivalent, definition of the derivative involving a product to make use of the given property.  It is valid since $xh \to x$ as $h \to 1$.
$$
\begin{align*}
f'(x) &= \lim_{h \to 1} \frac{f(xh) - f(x)}{xh-x}\\
      &= \lim_{h \to 1} \frac{f(x)+f(h) + \frac{x+h-1}{xh} - f(x)}{x(h-1)}\\
      &= \lim_{h \to 1} \frac{f(h) + \frac{x+h-1}{xh}}{x(h-1)}\\
      &= \lim_{h \to 1} \frac{f(h) - f(1) + f(1) +  \frac{x+h-1}{xh}}{x(h-1)}\\
      &= \lim_{h \to 1} \frac{1}{x}\frac{f(h) - f(1)}{h-1} + \frac{-1+ \frac{x+h-1}{xh}}{x(h-1)} \textrm{ since $f(1) = -1$}\\
      &= \frac{1}{x} f'(1) + \lim_{h \to 1} \frac{x+h-xh-1}{x^2h(h-1)}\\
      &= \frac{2}{x}  + \lim_{h \to 1} \frac{(1-x)(h-1)}{x^2h(h-1)}\\
      &= \frac{2}{x} +  \lim_{h \to 1} \frac{(1-x)}{x^2h}\\
      &= \frac{2}{x} +  \frac{1}{x^2} - \frac{1}{x}\\
      &= \frac{1}{x} + \frac{1}{x^2}
\end{align*}
$$
Hence $f'(x) = x^{-1} + x^{-2}$, so $f(x) = \ln(x) - \frac{1}{x} + C$
Now using $f(1) = -1 $ we obtained $C=0$.
