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)