In this lecture note we study how to solve a quadratic equation $ax^2+bx+c=0$. There are three ways to solve a quadratic equation. The first one is
1. By Factoring: This is a typical method to solve a quadratic equation whenever the polynomial $ax^2+bx+c$ can be easily factored. Here is an example.
Example. Solve the quadratic equation $x^2-3x-4=0$ by factoring.
Solution. The polynomial $x^2-3x-4$ is factored as $(x-4)(x+1)$. So the equation is $(x-4)(x+1)=0$. This means that $x-4=0$ or $x+1=0$, i.e. we obtain two real solutions $x=-1$ or $x=4$.
Example. Solve the quadratic equation $x^2-3=0$.
Solution 1. Recall the factorization formula $(a^2-b^2)=(a+b)(a-b)$. Now
\begin{align*}
x^2-3&=x^2-(\sqrt{3})^2\\
&=(x+\sqrt{3})(x-\sqrt{3}).
\end{align*}
Thus our equation becomes $(x+\sqrt{3})(x-\sqrt{3})=0$ whose solutions are $x=\pm\sqrt{3}$.
Solution 2. The quadratic equation can be written as $x^2=3$. Solving this equation for $x$, we obtain $x=\pm\sqrt{3}$.
Next method is
2. By Completing the Square:
This is a method that can be used to solve any quadratic equation. First note that \begin{equation}\label{eq:cts}x^2+bx+\left(\frac{b}{2}\right)^2=\left(x+\frac{b}{2}\right)^2.\end{equation}
Example. Solve the equation $x^2-6x-10=0$ by completing the square.
Solution. By adding 10 to each side of the equation, we obtain
\begin{equation}\label{eq:cthex1}x^2-6x=10.\end{equation} Note that half of the coefficient of $x$ is $\frac{-6}{2}=-3$. Add $(-3)^2$ to each side of \eqref{eq:cthex1}:
\begin{equation}\label{eq:cthex1a}x^2-6x+(-3)^2=10+(-3)^2.\end{equation} Now notice that the LHS of \eqref{eq:cthex1a} is exactly the same form as the LHS of the forumula \eqref{eq:cth}. Hence, the equation \eqref{eq:cthex1a} becomes
$$(x-3)^2=19.$$ Solving this for $x-3$, we obtain $x-3=\pm\sqrt{19}$. That is, $x=3\pm\sqrt{19}$.
While completing the square can be a useful tool for some other things, I do not strongly recommend this method because there is a more convenient method of solving quadratic equations.
3. By the Quadratic Formula:
If you apply the method by completing the square to solve the quadratic equation $ax^2+bx+c=0$, we obtain the quadratic formula
\begin{equation}\label{eq:quadform}x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\end{equation}
Example. Solve the quadratic equation $3x^2+2x-7=0$.
Solution. $a=3$, $b=2$, and $c=-7$. Thus
\begin{align*}
x&=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\\
&=\frac{-2\pm\sqrt{2^2-4(3)(-7)}}{2(3)}\\
&=\frac{-1\pm\sqrt{22}}{3}.
\end{align*}
The expression inside radical $b^2-4ac$ is called the discriminant. Using the discriminant, we can tell the following without solving the equation itself.
Theorem. For $ax^2+bx+c=0$ with $a\ne 0$,
- If $b^2-4ac>0$, then the equation has two distinct real solutions.
- If $b^2-4ac=0$, then the equation has only one real solution (which is $x=-\frac{b}{2a}$).
- If $b^2-4ac<0$, then the equation has two complex solutions that are conjugate of each other.
Update: There is a convenient formula for quadratic equations of the form $ax^2+bx+c=0$ with $b=2b’$ i.e. a multiple of 2. I wrote about it as a forum entry. For details click here.