problem on sequence of uniform random variable

Let $X_i, i \geq 1,$ be independent uniform (0, 1) random variables, and define $N$ by $$N=\min\{n:X_n < X_{n-1}\}$$ where $X_0 = x$. Let $f(x) = E[N | X_0=x]$

(a) Derive an integral equation for $f(x)$ by conditioning on $X_1$.

(b) Differentiate both sides of the equation derived in part (a).

(c) Solve the resulting equation obtained in part (b) to claculate $E[N | X_0=x]$.

My solution is the following :

$$E[N | X_0=x] = \int_{0}^{x} dx_1 + \int_{x}^{1}(1+E[N | X_0=x]) dx_1$$. In this way I am getting $E[N | X_0=x] = 1/x$. but the correct answer is $e^{1-x}$ which is found by calculating the probability $$P(N \geq k | X_0 =x)=\frac{(1-x)^{k-1}}{(k-1)!}$$ and then summing up over $k$. I am wrong somewhere but not able to understand where.

-

The second integral corresponds to the event that $X_1=y$ for some $y\gt x$. Then $N=1+N'$ where $N'$ is the functional $N$ applied to the shifted process $(X'_n)_{n\geqslant0}=(X_{n+1})_{n\geqslant0}$. In particular, conditionally on $X_1=y$, $E[N'\mid X_1=y]=E[N\mid X_0=y]$. Considering $f(x)=E[N\mid X_0=x]$ for every $x$, one sees that this decomposition yields the identity $$f(x) = \int_0^x1\cdot\mathrm dy + \int_x^1(1+f(y))\cdot\mathrm dy=1+\int_x^1f(y)\mathrm dy,$$ from which one can proceed.
The integral identity proposed in the question corresponds to $\bar N=\inf\{n:X_n\lt X_0\}$, not to $N$. And it is a fact that, conditionally on $X_0=x$, $\bar N$ is geometric with parameter $x$, hence $E[\bar N\mid X_0=x]=1/x$.
I have elaborated the problem definition. I think that $\frac{1}{x}$ is not the correct answer. –  podu Apr 27 '13 at 17:36
how $E[N | X_0=x]$ comes out as $e^{1-x}$ from the integral equation ? –  podu Apr 29 '13 at 1:51