# Find $f(x)$ such that $f(x) = 1 + \frac1{x} \int_1^x f(t) \mathrm{d}t$. What am I doing wrong?

I need to find a continuous function defined for real and positive $x$ such that $f(x) = 1 + \frac1{x} \int_1^x f(t)\ \mathrm{d}t$. What I did is the following:

\begin{align*}f(x) &= 1 + \frac1{x} \int_1^x f(t)\ \mathrm{d}t\\ x(f(x) - 1) &= \int_1^x f(t) \ \mathrm{d}t \end{align*}

Differentiating both sides:

\begin{align*} f(x) - 1 + x f'(x) &= f(x)\\ f'(x) &= \frac1{x}\\ f(x) &= \ln x \end{align*}

Which looks alright. But when checking to make sure, I get this:

\begin{align*} f(x) &= 1 + \frac1{x} \int_1^x \ln t \ \mathrm{d}t\\ f(x) &= 1 + \frac1{x} (x(\ln x -1)|_1^x)\\ f(x) &= 1 + \frac1{x} (x(\ln x -1) - (\ln 1 - 1))\\ f(x) &= 1 + \ln x - 1 + \frac1{x}\\ f(x) &= \ln x + \frac1{x} \end{align*}

which is different from what I got before. What is my mistake here?

-
How about the constant when integrating 1/x into lnx? – gary Nov 25 '11 at 1:51
You are correct up to here: $f'(x) = 1/x.$ However, that does not imply immediately $f(x) = \ln x$, but rather $f(x) = \ln x + C$ where $C$ is the arbitrary constant of integration. – Ragib Zaman Nov 25 '11 at 1:52
We have $f(x)=\ln x +C$. Evaluate $C$ by going back to the original equation and putting $x=1$. The integral dies, and you get $\ln( 1) + C=1$. – André Nicolas Nov 25 '11 at 1:59

You left out the constant of integration... the answer is actually $\ln(x) + 1$.