When do we specify restrictions in rational expressions or equations In the following equation $x \neq 0$ apply's according to wolframalpha (expanded form).
$$\frac{x^3 + x^2}{2x} = \frac{x^2 + x}{2}$$
Yet in the following equation it does not...
$$\frac{ab^2}{b} = 5 \iff ab = 5$$
Why don't we specify the restriction $b \neq 0$ here? And when do we specify restrictions in general?

I think that
$$\dfrac{x^3 + x^2}{2x} = \dfrac{x^2 + x}{2} \Leftrightarrow 
\begin{cases}
2x\cdot \dfrac{x^3 + x^2}{2x}=2x\cdot \dfrac{x^2 + x}{2}\\
2x\neq 0
\end{cases}$$
Also $$\dfrac{ab^2}{b} = 5 \iff 
\begin{cases}
b\cdot\dfrac{ab^2}{b}=b\cdot 5\\
b\neq 0 \end{cases}\iff
\begin{cases}
ab^2=5b\\
b\neq 0 \end{cases}\iff\begin{cases}
 b\cdot (ab-5)=0\\
b\neq 0\end{cases}\iff ab=5$$
I a general way: $$\dfrac{A}{B}=C\iff \begin{cases}
B\cdot \dfrac{A}{B}=B\cdot C\\
B\neq 0 \end{cases}$$
