These stages are inverting. Your equations are both missing a - in the transfer function.
V1 gets inverted twice, that's why it has a positive coefficient. V2 gets inverted once, that's why it has a negative coefficient.
The textbook is correct.
Let \$R_{1\text{L}}\$ and \$R_{2\text{L}}\$ refer to the leftmost \$R_1\$ and \$R_2\$, respectively, and \$R_{1\text{R}}\$ and \$R_{2\text{R}}\$ refer to the rightmost \$R_1\$ and \$R_2\$, respectively.
The voltage at the inverting input of the op amp is \$V_- = V_{\text{in}}\$, so the current through \$R_{1\text{L}}\$ is \$V_{\text{in}}/R_{1\text{L}}\$. Since there is ideally no current into the op amp's input, the current through \$R_{2\text{L}}\$ is also \$V_{\text{in}}/R_{1\text{L}}\$.
The voltage across \$R_{2\text{L}}\$ is
$$\frac{V_{\text{in}}}{R_{1\text{L}}}R_{2\text{L}}$$
by Ohm's Law.
The voltage \$V_M\$ at the middle node (at the T intersection of the resistors) is therefore
$$V_M = V_{\text{in}} + \frac{V_{\text{in}}}{R_{1\text{L}}}R_{2\text{L}} \tag1$$
The current through \$R_{1\text{R}}\$ is \$V_{M}/R_{1\text{R}}\$. The current through \$R_{2\text{R}}\$ is this current plus the current through \$R_{2\text{L}}\$:
$$\frac{V_{M}}{R_{1\text{R}}} + \frac{V_{\text{in}}}{R_{1\text{L}}}$$
so the voltage across it is
$$\left(\frac{V_{M}}{R_{1\text{R}}} + \frac{V_{\text{in}}}{R_{1\text{L}}}\right)R_{2\text{R}}$$
This voltage plus \$V_M\$ is \$V_{\text{out}}\$:
$$V_{\text{out}} = V_M + \left(\frac{V_{M}}{R_{1\text{R}}} + \frac{V_{\text{in}}}{R_{1\text{L}}}\right)R_{2\text{R}} \tag2$$
Substituting \$(1)\$ into \$(2)\$ and dropping the L and R from the subscripts:
$$\begin{split}V_{\text{out}} &= V_{\text{in}} + \frac{V_{\text{in}}}{R_{1}}R_{2} + \left(\frac{V_{\text{in}} + \frac{V_{\text{in}}}{R_{1}}R_{2}}{R_{1}} + \frac{V_{\text{in}}}{R_{1}}\right)R_{2} \\ &= V_{\text{in}}\left(1 + \frac{R_{2}}{R_{1}} + \frac{R_{2}}{R_{1}} + \frac{R_{2}^2}{R_{1}^2} + \frac{R_{2}}{R_{1}}\right) \\ &= V_{\text{in}}\left(1 + 3\frac{R_{2}}{R_{1}} + \frac{R_{2}^2}{R_{1}^2}\right)\end{split}$$
$$\boxed{\frac{V_{\text{out}}}{V_{\text{in}}} = 1 + 3\frac{R_{2}}{R_{1}} + \frac{R_{2}^2}{R_{1}^2}}$$
Best Answer
Your equation for Vin is wrong. The same current flows through R1 and R2, hence express V1 in terms of Vin.
Also, the last term in the node V1 equation is wrong: \$\Sigma\$currents away from node \$=0\$