What is the expected time $d_j$ until $j-1$ green balls remain, having started with $j$ green and $j+2$ red balls
The formula with the red arrow is not OK for me, can you explain why it is correct ?
Say $X_n=k$ is the event that for some $n$ we have $k$ green balls left in the urn.
$d_j=E(X_n=j-1|X_0=j)=1+E(X_n=j-1|X_0=j,X_1=j-1)\Pr(X_1=j-1)+E(X_n=j-1|X_0=j,X_1=j+1)\Pr(X_1=j+1)=1+0+d_{j+1}\frac{j}{2j+2}$
but in the book it is $d_j=1+\frac{j}{2j+2}(d_{j+1}+d_j)$
where is my mistake ?


I think there may be some confusion attached to the meaning of $d_k$ for various $k$. If you mean $d_k$ is the expected time it takes to have $j-1$ green balls left (i.e. if the reference is always to the same $j-1$), then your answer is correct. However, i think it is more natural to define $d_k$ as the expected time it takes to get to $k-1$ green balls and if you define it that way then the other answer is correct. After all, in that case you either resolve the situation on the first draw or you go up to $j+1$ green balls and then must first get back to $j$ (which is expected to take $d_{j+1}$ draws) and from there get to $j-1$ (which is expected to take $d_j$ draws).