Suppose someone starts walking at an integer $c$. At any time, he cannot leave the interval $[a,b]$. At each step, he can either walk one step left with probability $\frac{1}{2}$ or walk one step right with probability $\frac{1}{2}$ (if he is at either end, he can only walk one step in the opposite direction.). I'd like to ask if there is a closed-form solution for the expected first hitting time of an integer $d$.
Note: WLOG, assume $a \le c \leq d \leq b$. Let $E_x$ be the expected first hitting time starting from $x$. We have $\begin{equation}\begin{cases}E_x&=1+\frac{1}{2}E_{x-1}+\frac{1}{2}E_{x+1} \ (x \neq d, a \lt x \lt d) \\ E_d&=0 \\ E_a&=1+E_{a+1}\end{cases}\end{equation}$.
We want to calculate $E_{c}$.
Note2: By calculating small terms, it seems that the answer is exactly $(d-a+1)^2-(c-a)^2$. I'm not sure how to prove or disprove it.