I cannot for the life of me see why my solution method gives me the wrong result.
A machine works for an exponentially distributed time with rate $\mu$ then fails. A crew checks the machine at times according to a Poisson process with rate $\lambda$; if the machine has failed, it's immediately replaced. Find the expected time between replacements.
Ross Probability Models, 10th Ed. Ch. 5, Ex. 37.
My Solution: Let $T_M$ be time until machine's failure. Let $T_C$ be time until the crew checks. Let $T_R$ be time until the next replacement.
$$\begin{split}E[T_R]&=E[T_R|T_M\leq T_C]P(T_M\leq T_C)+E[T_R|T_C\leq T_M]P(T_C\leq T_M)\\ &=\left(\frac1\mu+\frac1\lambda\right)\left(\frac\mu{\lambda+\mu}\right)+\left(\frac1\lambda+E[T_R]\right)\left(\frac\lambda{\lambda+\mu}\right).\\ &\Rightarrow E[T_R]=\frac2\mu+\frac1\lambda\end{split}$$
but the solutions manual disagrees and suggests
$$\frac1\mu+\frac1\lambda$$
where did I make an error?
For a rigorous proof, let $\{N_t\}$ be the Poisson process related to crew check. Accordingly, denote $X_1, X_2, \ldots$ to be the independent random exponential random variables representing the time between events and $S_n = X_1 + \cdots + X_n$.
For fixed $t > 0$, define $X^{(t)} = S_{N_t + 1} - t$. For a machine that starts working at time $0$, if a failure occurs at time $t$, then the time to the replacement is given by $X^{(t)}$. Our goal is to compute $E[X^{(t)}]$.
We first show that conditioning on the event $[N_t = n]$, $X^{(t)} \sim \exp(\lambda)$, which can be proved as follows: for any $y > 0$ and each $n \in \{0, 1, 2, \ldots\}$, \begin{align} & P[X^{(t)} > y \mid N_t = n] \\ = & \frac{P[X^{(t)} > y, N_t = n]}{P[N_t = n]} \\ = & \frac{P[S_{N_t + 1} > y + t, N_t = n]}{P[N_t = n]} \\ = & \frac{P[S_{n + 1} > y + t, N_t = n]}{P[N_t = n]} \\ = & \frac{P[S_{n + 1} > y + t, S_n \leq t < S_{n + 1}]}{P[N_t = n]} \tag{$*$} \\ \end{align} where we used the definition of Poisson process: $[N_t = n] = [S_n \leq t < S_{n + 1}]$. Use independence of $X_{n + 1}$ and $S_n$, if denoting the distribution function of $S_n$ by $G_n$, then the numerator of $(*)$ is: \begin{align} & P[S_{n + 1} > y + t, S_n \leq t < S_{n + 1}] \\ = & P[X_{n + 1} > y + t - S_n, S_n \leq t < X_{n + 1} + S_n] \\ = & P[X_{n + 1} > y + t - S_n, S_n \leq t] \\ = & \int_0^t P[X_{n + 1} > y + t - s] dG_n(s) \\ = & \int_0^t e^{-\lambda(y + t - s)} dG_n(s) \\ = & e^{-\lambda y} \int_0^t e^{-\lambda(t - s)} dG_n(s) \\ = & e^{-\lambda y} P[X_{n + 1} > t - S_n, S_n \leq t] \\ = & e^{-\lambda y} P[S_n \leq t < S_{n + 1}] \\ = & e^{-\lambda y} P[N_t = n]. \\ \end{align} Therefore $(*)$ reads as $$P[X^{(t)} > y \mid N_t = n] = e^{-\lambda y}$$ hence the claim is true, consequently, $E[X^{(t)}|N_t = n] = \frac{1}{\lambda}$, then $$E[X^{(t)}] = E\{E[X^{(t)}|N_t]\} = \sum_{n = 0}^\infty E[X^{(t)}|N_t = n]P[N_t = n] = \frac{1}{\lambda}\sum_{n = 0}^\infty P[N_t = n] = \frac{1}{\lambda}.$$
Finally, suppose a new machine started working at time $0$ (which is also the time the most recent replacement occurs), it failed at $t$, with the notation above, the time it will be replaced is $t + X^{(t)}$. Let $Y$ be the failure time of that machine, the time between replacements $R$ can then be expressed as $R = Y + X^{(Y)}$. Since $Y$ and $N_t$ are independent, we have $$E[X^{(Y)}] = E\{E[X^{(Y)}|Y]\} = \int_0^\infty E[X^{(t)}|Y = t]\mu e^{-\mu t} dt = \int_0^\infty E[X^{(t)}]\mu e^{-\mu t} dt = \frac{1}{\lambda}.$$ Therefore, $$E[R] = E[Y] + E[X^{(Y)}] = \frac{1}{\mu} + \frac{1}{\lambda}.$$