How to identify whether $m = \infty$ is a solution? While solving questions on coordinate geometry, I am facing some difficulty in solving equations on $m$ (slope). Unlike the variables we deal with in normal algebra, $m$ can be equal to $\infty$. This yields some extra solutions in many cases. Consider this example:

What are the equations of common tangents to $y^2 = 4ax$ and $(y-2)^2 = -4ax$?

Here is the traditional method to solve questions like this: Assume the slope of the common tangent to be $m$.
$$y = mx + \frac{a}{m}  \tag{1}$$
$$y = mx - \frac{a}{m}\tag{2}$$
We know that $(1)$ is tangent to $y^2 = 4ax$ and $(2)$ is tangent to $y^2 = -4ax$ , so $(x,y) \mapsto (x,y-2)$ in $(2)$ and then solving $(1)$ and $(2)$ we get,
$$ mx + \frac{a}{m} = mx - \frac{a}{m} +2 \tag{3}$$
$$ \implies m = a$$. 
However, observing the graph, we realise that $m= \infty$ is also a solution. It also makes sense in $(3)$ because as $m \rightarrow \infty, 1/m \rightarrow 0$ and $\infty = \infty +2$(because $\infty$ is already larger than any number so equality holds).
But is there any proper way to detect whether $m = \infty$ ? (Not taking the help of graph and not cross checking/back calculation).
For example, to allow $0$ to come as a solution, we are advised to factorise the expression instead of calcelling terms from both sides of equation. Similiarly, is there any strategy to allow $\infty$ to come as a solution?
 A: Rather than "allow $\infty$ to come as a solution" for a common tangent with equation of the form $\ y=mx+c\ $, I'd suggest looking for a common tangent with equation $\ \alpha x+\beta y+\gamma=0\ $, since any line in the Cartesian plane must have an equation of that form, where $\ \alpha\ $, $\ \beta\ $ and $\ \gamma\ $ are just real numbers with $\ \alpha,\beta\ $ not both $0$. Your solutions with $\ m=\infty\ $ correspond to tangent lines with equations of the above form with $\ \beta=0\ $.
If you're seeking the common tangents to curves with equations $\ f(x,y)=0\ $ and $\ g(x,y)=0\ $, then the points $\ \big(x_f,y_f\big)\ $ and $\ \big(x_g,y_g\big)\ $ of tangency must satisfy
\begin{align}
f\big(x_f,y_f\big)&=0\ ,\\
\alpha x_f+\beta y_f+\gamma&=0\ ,\\
g\big(x_g,y_g\big)&=0\ ,\text{and}\\
\alpha x_g+\beta y_g+\gamma&=0\ ,
\end{align}
and for the line $\ \alpha x+\beta y+\gamma=0\ $ to be tangent to the curve $\ f(x,y)=0\ $ at $\ \big(x_f,y_f\big)\ $ and tangent to the curve $\ g(x,y)=0\ $ at $\ \big(x_g,y_g\big)\ $, the coefficients $\ \alpha,\beta\ $ must satisfy
\begin{align}
\alpha\frac{\partial f}{\partial y}\big(x_f,y_f\big)-\beta\frac{\partial f}{\partial x}\big(x_f,y_f\big)&=0\ ,\ \text{ and}\\
\alpha\frac{\partial g}{\partial y}\big(x_g,y_g\big)-\beta\frac{\partial g}{\partial x}\big(x_g,y_g\big)&=0\ .
\end{align}
For your example,
\begin{align}
f(x,y)&=y^2-4ax\ ,\ \text{and}\\
g(x,y)&=(y-2)^2+4ax\ ,
\end{align}
$\ \big(x_f,y_f\big),\big(x_g,y_g\big), \alpha, \beta\ $ and $\ \gamma\ $ must satisfy the equations
\begin{align}
y_f^2-4ax_f&=0\ ,\\
(y_g-2)^2+4ax_g&=0\ ,\\
\alpha x_f+\beta y_f+\gamma&=0\ ,\\
\alpha x_g+\beta y_g+\gamma&=0\ ,\\
2\alpha y_f+4a\beta&=0\ \text{and}\\
2\alpha(y_g-2)-4a\beta&=0\ .\\
\end{align}
I'll assume here that $\ a\ne0\ $. Then it follows from the last two equations that $\ \beta=\frac{\alpha y_f}{2a}=\frac{\alpha(2-y_g)}{2a}\ $, and hence that $\ \alpha\ne0\ $ (because otherwise $\ \beta=0=\alpha\ $, which is not allowed). Therefore, $\ y_f=-\frac{2a\beta}{\alpha}\ $,$\ y_g-2= \frac{2a\beta}{\alpha}\ $, $\  x_f=\frac{a\beta^2}{\alpha^2}\ $ (from the first equation) and $\ x_g=-\frac{a\beta^2}{\alpha^2}\ $ (from the second). Substituting these values into the third and fourth equations gives
\begin{align}
\gamma&=\frac{a\beta^2}{\alpha}\\
&=-\beta\left(2+\frac{a\beta}{\alpha}\right)\ ,
\end{align}
which implies
$$
\beta\left(1+\frac{a\beta}{\alpha}\right)=0\ ,
$$
and either $\ \beta=0\ $ or $\ \beta=-\frac{\alpha}{a}\ $.  If $\ \beta=0\ $, then $\ \gamma=0\ $ and the equation of the corresponding common tangent is $\ \alpha x=0\ $, or, equivalently, $\ x=0\ $. If $\ \beta=-\frac{\alpha}{a}\ $, then $\ \gamma=\frac{\alpha}{a}\ $ and the equation of the corresponding common tangent is
$$
\alpha x-\left(\frac{\alpha}{a}\right)y+\frac{\alpha}{a}=0\ ,
$$
or, equivalently, $\ y=ax+1\ $.
