To find the area of triangle formed by three straight lines Given is combined equation of three straight lines $$x^2 y -y^3-x^2+5y^2-8y+4=0$$
This can easily be factorized into three straight lines
- $y=1$
- $y=x+2$
- $y=2-x$
Now it will be easy to calculate intersection points and calculate the area as 1 sq units.
However, I was wondering if it were possible to calculate the area from the combined equation of the lines without actually finding the equations of the straight lines by making use of the coeffecients of the terms in the combined equation.
Before we start, let us recall a formula for the area of a triangle in terms of the lines bounding it.
Let $\hat{z}$ be the unit vector $(0,0,1)$. For any line $\ell : \alpha x + \beta y + \gamma = 0$ on the plane, we will use the same symbol $\ell$ to denote the affine function $\ell(x,y) = \alpha x + \beta y + \gamma$ and $\vec{\ell}$ to denote the vector $(\alpha,\beta,\gamma)$.
Given any three lines $\ell_i : \alpha_i x + \beta_i y + \gamma_i = 0$ for $i = 1,2,3$, the area of the triangle bounded by them is given by the formula: $$\verb/Area/ = \frac{D^2}{2C_1C_2C_3}$$ where
$$ D = \vec{\ell}_1 \cdot (\vec{\ell}_2 \times \vec{\ell}_3) = \left|\begin{matrix} \alpha_1 & \alpha_2 & \alpha_3 \\ \beta_1 & \beta_2 & \beta_3 \\ \gamma_1 & \gamma_2 & \gamma_3 \end{matrix}\right| \quad\text{ and }\quad \begin{cases} C_1 &= |\hat{z} \cdot (\vec{\ell}_2 \times \vec{\ell}_3 )| = \left\|\begin{matrix}\alpha_2 & \alpha_3\\ \beta_2 & \beta_3\end{matrix}\right\|\\ C_2 &= |\hat{z} \cdot (\vec{\ell}_3 \times \vec{\ell}_1 )| = \left\|\begin{matrix}\alpha_3 & \alpha_1\\ \beta_3 & \beta_1\end{matrix}\right\|\\ C_3 &= |\hat{z} \cdot (\vec{\ell}_1 \times \vec{\ell}_2 )| = \left\|\begin{matrix}\alpha_1 & \alpha_2\\ \beta_1 & \beta_2\end{matrix}\right\| \end{cases} $$ For a derivation of this result, please refer to my answer to a related question.
Let's back to our original problem. For simplicity, we will only consider the case where all $\beta_i = 1$. The union of the three lines is the zero set of a cubic polynomial:
$$\begin{align}f(x,y) &= \ell_1(x,y)\ell_2(x,y)\ell_3(x,y)\\ &= y^3 + by^2x + cyx^2 + dx^3 + ey^2 + fyx + gx^2 + hy + ix + j \end{align} $$ Partial differentiate against $y$, we obtain
$$\begin{align}\partial_y f(x,y) &= \ell_1(x,y) \ell_2(x,y) + \ell_2(x,y) \ell_3(x,y) + \ell_3(x,y) \ell_1(x,y)&\tag{*1a}\\ &= 3y^2 + 2bxy + 2ey + cx^2 + fx + h\\ &= \begin{bmatrix}x \\ y \\ 1\end{bmatrix}^T \begin{bmatrix}c & b & \frac{f}{2} \\ b & 3 & e\\ \frac{f}{2} & e & h\end{bmatrix} \begin{bmatrix}x \\ y \\ 1\end{bmatrix} & \tag{*1b} \end{align}$$ Let $\Delta$ be the $3 \times 3$ matrix having $\vec{\ell}_i$ at $i^{th}$ column and $\Lambda$ be the $3 \times 3$ matrix appear in $(*1b)$.
If we rewrite the RHS in $(*1a)$ in matrix form, we obtain
$$2\Lambda = \left(\vec{\ell}_1 \vec{\ell}_2^T + \vec{\ell}_2 \vec{\ell}_1^T\right) + \left(\vec{\ell}_2 \vec{\ell}_3^T + \vec{\ell}_3 \vec{\ell}_2^T\right) + \left(\vec{\ell}_3 \vec{\ell}_1^T + \vec{\ell}_1 \vec{\ell}_3^T\right) = \Delta \begin{bmatrix}0 & 1 & 1 \\ 1 & 0 & 1 \\ 1 & 1 & 0\end{bmatrix} \Delta^T $$ This leads to
$$D^2 = (\det\Delta)^2 = \frac12\det(2\Lambda) = 12ch-4b^2h-3f^2+4bef-4ce^2\tag{*2}$$
Since all $\beta_i = 1$, we have
$$(C_1C_2C_3)^2 = (\alpha_2 - \alpha_3)^2(\alpha_3 - \alpha_1)^2(\alpha_1-\alpha_2)^2$$
Notice $-\alpha_i$ are roots of the cubic polynomial $\lambda^3 + b\lambda^2 + c\lambda + d = 0$. The expression on RHS is nothing but the discriminant of this cubic polynomial. i.e.
$$(C_1C_2C_3)^2 = b^2c^2 - 4c^3 - 4b^3d - 27d^2 + 18bcd\tag{*3}$$
Combine $(*2)$ and $(*3)$, we obtain
$$\verb/Area/ = \frac{12ch-4b^2h-3f^2+4bef-4ce^2}{2\sqrt{b^2c^2 - 4c^3 - 4b^3d - 27d^2 + 18bcd}}$$
As an example, consider the case
$$\begin{align} & x^2 y - y^3 - x^2 + 5y^2 - 8y + 4 = 0\\ \iff & y^3 - x^2 y - 5y^2 + x^2 + 8y - 4 = 0\\ \iff & (c,e,g,h,j) = (-1,-5,1,8,-4), b = d = f = i = 0 \end{align} $$ Since $b = d = f = i = 0$, the area reduces to $$\verb/Area/ \leadsto \frac{12ch-4ce^2}{2\sqrt{- 4c^3}} = \frac{12(-1)(8)-4(-1)(-5)^2}{2\sqrt{-4(-1)^3}} = \frac{4}{2\sqrt{4}} = 1$$ as expected.