How to compute intersection multiplicity of $l,f$ in the improper point or point of $l$ in the infinity $m_\infty$?
Solution 1:
Each $m_i$ corresponds to a unique point of intersection $P$ in the affine plane, and you take the sum over all points of intersection. For instance, if you take the curve given by $x^3+y^3=2$ and the line $x+y=1$, you have two intersection points in the affine plane at $(\frac{3-\sqrt{21}}6,\frac{3+\sqrt{21}}6)$ and $(\frac{3+\sqrt{21}}6,\frac{3-\sqrt{21}}6)$, both of which have intersection multiplicity one: $x^3+(1-x)^3=2$ simplifies to $3x^2-3x-1=0$, or $3(x-\frac{3+\sqrt{21}}6)(x-\frac{3-\sqrt{21}}6)=0$. So the sum is $2$, giving that $m_\infty=1$, and sure enough you can check that the two curves intersect with multiplicity one in one point at infinity.
Put another way, for a fixed line $l$, the number $m_\infty$ is the difference in degree between $f(x,y)$ and $f(x,ax+b)$.
Separately, have you considered perhaps looking at another source for this intersection multiplicity material? It seems the definition in the text you're looking at has been somewhat confusing and it might help you to see how other texts treat it.