Automatic differentiation-Reverse mode I am trying to understand very basics material and a bit confused about steps.
If we have function $z=f(x_1,x_1)=x_1x_2+sinx_1=w_1w_2+sinw_1=w_1+w_4=w_5$ we need  fix the dependent variable to be differentiated and computes the derivative with respect to each sub-expression recursively, according to chain rule we have - 
$\frac{dy}{dx}=\frac{dy}{dw_1}\frac{dw_1}{dx}=(\frac{dy}{dw_2}\frac{dw_2}{dw_1})\frac{dw_1}{dx}=(((\frac{dy}{dw_4}\frac{dw_4}{dw_3})\frac{dw_3}{dw_2})\frac{dw_2}{dw_1})\frac{dw_1}{dx}=((((\frac{dy}{dw_5}\frac{dw_5}{dw_4})\frac{dw_4}{dw_3})\frac{dw_3}{dw_2})\frac{dw_2}{dw_1})\frac{dw_1}{dx}$ 
$w_1=x_1, w_2=x_2$
$\bar w=\frac{dy}{dw}$
Then I have the next calculation-
1) $\bar f =\bar w_5 = 1 $ seed
2) $\bar w_4=$$\bar w_5$$\frac{dw_5}{dw_4}=$$\bar w_5 *1$
2) $\bar w_3=$$\bar w_5$$\frac{dw_5}{dw_3}=$$\bar w_5 *1$
3) $\bar w_2=$$\bar w_3$$\frac{dw_3}{dw_2}=$$\bar w_3 w_1$
I don't really see how we obtained these steps from the chain.
Can somebody explain it more clearly, please!
 A: In this example,
$$ \eqalign{w_1 &= x_1\cr
            w_2 &= x_2\cr
            w_3 &= w_1 w_2\cr
            w_4 &= \sin(w_1)\cr
            z = w_5 &= w_3 + w_4\cr}$$
EDIT: In reverse mode, you work with the adjoints $\overline{w_j} = \partial z/\partial w_j$, using the chain rule.  For each node in the computation graph, you compute this using the  nodes to which it is an input.
You start with $\overline{w}_5 = 1$.
$w_4$ is an input only to $w_5$, through the equation $w_5 =w_3 + w_4$, so
$$\overline{w_4} = \dfrac{\partial z}{\partial w_5} \dfrac{\partial w_5}{\partial w_4} = \overline{w_5} $$
Similarly, $\overline{w_3} = \overline{w_5} $.
$w_2$ is an input to $w_3$ through $w_3 = w_1 w_2$, so
$$ \overline{w_2} = \dfrac{\partial z}{\partial w_3} \dfrac{\partial w_3}{\partial w_2} = \overline{w_3} w_1$$
$w_1$ is an input to both $w_3$ and $w_4$, so
$$ \overline{w_1} 
=   \dfrac{\partial z}{\partial w_3} \dfrac{\partial w_3}{\partial w_1} + \dfrac{\partial z}{\partial w_4} \dfrac{\partial w_4}{\partial w_1} = \overline{w_3} w_2 + \overline{w_4} \cos(w_1)$$           
