While solving a problem, I came across this function: $$y=\frac{12+x+0.02x^2}{3+0.1x}$$ It is a linear function except it is discontinuous at a single point. When I plotted it in wolfram alpha, it suggested the alternate form of $y=0.2x+4$ with the condition that $x\neq-30$. The problem would have been much easier to solve using the alternate form given that $x=-30$ is not a physical solution.
My question would be, how did wolfram determine this? Obviously when I look at the graph I can come up with the same linear function, but is there a way to mathematically "simply away the -30 case" or something to get the alternate form just from the original equation? (without plotting)
$$y=\frac{12+x+0.02x^2}{3+0.1x}=\frac{600+50x+x^2}{150+5x}=\frac{(20+x)(30+x)}{5(30+x)}=\frac{20+x}{5}=4+0.2x$$
where dividing through by $30+x$ requires $x \neq -30$