[step:Handle the vertical line case and conclude the formula]If $Q=-P$, then $Q=(x_1,-y_1)$. Let $\mathbb{P}^2_{\mathbb{F}_p}$ denote the projective plane over $\mathbb{F}_p$, whose points are equivalence classes $[X:Y:Z]$ of nonzero triples $(X,Y,Z) \in \mathbb{F}_p^3$ under nonzero scalar multiplication. Define the [projective closure](/page/Projective%20Closure) $\overline{E} \subset \mathbb{P}^2_{\mathbb{F}_p}$ by the homogeneous equation
\begin{align*}
Y^2Z=X^3+aXZ^2+bZ^3,
\end{align*}
and define the [point at infinity](/page/Point%20at%20Infinity) by $O=[0:1:0] \in \overline{E}(\mathbb{F}_p)$. The affine point $(x,y)$ corresponds to $[x:y:1]$. The vertical affine line $x=x_1$ has projective closure $L \subset \mathbb{P}^2_{\mathbb{F}_p}$ defined by
\begin{align*}
X-x_1Z=0.
\end{align*}
Substituting $X=x_1Z$ into the homogeneous equation of $\overline{E}$ gives
\begin{align*}
Y^2Z=x_1^3Z^3+ax_1Z^3+bZ^3.
\end{align*}
On the affine chart $Z \ne 0$, this is exactly
\begin{align*}
y^2=x_1^3+ax_1+b=y_1^2.
\end{align*}
Equivalently, along the affine vertical line define the polynomial function $g: \mathbb{F}_p \to \mathbb{F}_p$ by
\begin{align*}
g(y):=y^2-y_1^2.
\end{align*}
The affine intersections are the roots of $g$. If $y_1 \ne 0$, then $g(y)=(y-y_1)(y+y_1)$ has the two distinct roots $y_1$ and $-y_1$, because $p \ne 2$. If $y_1=0$, then $g(y)=y^2$, so $y=0$ is a root of multiplicity two. Hence the affine intersections are $[x_1:y_1:1]=P$ and $[x_1:-y_1:1]=Q$, with the affine point counted twice in the tangent case $y_1=0$. On the line at infinity $Z=0$, the equation $X-x_1Z=0$ gives $X=0$, and the unique projective point on $L$ with $Z=0$ is $[0:1:0]=O$. At $O=[0:1:0]$, use the affine projective chart $Y \ne 0$ with local coordinates $u=X/Y$ and $v=Z/Y$. In these coordinates $O$ is $(u,v)=(0,0)$, the vertical line equation becomes $u-x_1v=0$, and the homogeneous curve equation becomes
\begin{align*}
v=u^3+auv^2+bv^3.
\end{align*}
Substituting $u=x_1v$ gives
\begin{align*}
v=x_1^3v^3+ax_1v^3+bv^3,
\end{align*}
or equivalently
\begin{align*}
v\bigl(1-(x_1^3+ax_1+b)v^2\bigr)=0.
\end{align*}
The factor in parentheses has value $1$ at $v=0$, so it is nonzero at $O$; hence $v=0$ occurs with multiplicity one. Thus $O$ is the third projective intersection point with the correct multiplicity. The [chord-and-tangent law](/page/Chord-and-Tangent%20Law) defines $P+Q$ as the reflection of this third point. Since $O$ is fixed by negation, this gives
\begin{align*}
P+Q=O.
\end{align*}
It remains to record the identity cases involving $O$. Let $P=(x_1,y_1) \in E(\mathbb{F}_p)$ be an affine point. The projective line through $P=[x_1:y_1:1]$ and $O=[0:1:0]$ is the vertical line $X-x_1Z=0$, because both points satisfy this linear equation. The computation above shows that the third affine intersection is $-P=[x_1:-y_1:1]$, counted with multiplicity in the case $y_1=0$. Reflecting this third point gives $P$. Hence the chord-and-tangent law gives
\begin{align*}
P+O=P
\end{align*}
and, by the same line with the two inputs interchanged,
\begin{align*}
O+P=P.
\end{align*}
Also $O+O=O$ because $O$ is defined as the identity point of the projective group law.
For $Q \ne -P$, the chord case and tangent case prove that the third intersection point has $x$-coordinate
\begin{align*}
x_3=\lambda^2-x_1-x_2
\end{align*}
and that its reflection has $y$-coordinate
\begin{align*}
y_3=\lambda(x_1-x_3)-y_1.
\end{align*}
Hence the chord-and-tangent addition law on $E(\mathbb{F}_p)$ is exactly
\begin{align*}
P+Q=(x_3,y_3),
\end{align*}
with the exceptional vertical case giving $P+Q=O$.[/step]