Brain Dump

Quadratic Equation

Tags
math

Is an equation of the form \( y = f(x) = ax^2 + bx + c \).

We define the roots of a equation as the values of \( x \) for which the equation equals \( 0 \). These roots are valuable because they can tell us when the line of the equation intercepts the x-axis.

The roots of a quadratic equation (and for that any equation with real-valued roots up to any power of \( x \) including cubic equations) can be factorised into a form like \( (ix+n)(jx+m) \). Quadratics have 2 roots therefore it has up-to 2 parentheses. Cubics have upto 3, and so-on and so-forth. The advantage of this form is the roots of the equation are immediately obvious. If we set \( x = \frac{-n}{i} \) then the first term in the quadratic expansion evaluates to \(0\) and therefore the overall value of the equation will also be \(0\) (recall \( 0 \times x = 0 \forall x \)). A simple way to find this form is to find the values of \( n \) and \( m \) such that \( nm = c \) and \( jn+im = b \).

This is most easily demonstrated when \( j = i = 1 \). Take for example \( x^2 + 2x -3 \). We want to solve \( nm = -3 \) and \( n+m = 2 \). For \( nm = -3 \) this can be one of \( (-3) \times 1 = (-1) \times 3 = -3 \). The only one of these pairs for which \( n+m = 2 \) is \( n=-1, m=3 \). Therefore the factorised form of this equation is \( (x-1)(x+3) \), which means the roots of this equation is \( x=1, x=-3 \).

For more complex equations the roots might be harder to find, in which case you can rely on the quadratic-formula.

Discriminant

The discriminant \( b^2 - 4ac \) tells you how many roots the equation has:

\begin{align} b^2 - 4ac \begin{cases}

&0, \; \text{Equation has 2 distinct roots, see Figure \ref{fig:quadratic-two-roots}} \
= &0, \; \text{Equation has 1 distinct roots, see Figure \ref{fig:quadratic-one-root}} \

\end{cases} \end{align}

Quadratic Formula

For a quadratic formula \( y = ax^2 + bx + c \), the real roots can be found as:

\begin{align} x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \end{align}

\begin{figure}
  \centering
  \begin{tikzpicture}
    \begin{axis}[axis lines=center, domain=-10:10]
      \addplot[color=red]{x^2 - 16};,
      \addplot[color=blue]{-x^2 + 16};,
	   \addplot[only marks] coordinates {(-4, 0) (4, 0)};,
    \end{axis}
  \end{tikzpicture}
  \caption{Example of a quadratic function with two roots.
	   The red plot has the equation \( (x + 4)(x - 4) \).
	   The blue plot has the equation \( (-x + 4)(x + 4) \).}
  \label{fig:quadratic-two-roots}
\end{figure}

\begin{figure}
  \centering
  \begin{tikzpicture}
    \begin{axis}[axis lines=center, domain=-10:10]
      \addplot[color=red]{x^2 - 8*x + 16};,
      \addplot[color=blue]{-x^2 + 8*x - 16};,
      \addplot[only marks] coordinates {(4, 0)};,
    \end{axis}
  \end{tikzpicture}
  \caption{Example of a function with only 1 root.
	   The red plot has the equation \( (x - 4)^2 \).
	   The blue plot has the equation \( (-x + 4)^2 \).}
  \label{fig:quadratic-one-root}
\end{figure}

\begin{figure}
  \centering
  \begin{tikzpicture}
    \begin{axis}[axis lines=center, domain=-10:10]
      \addplot[color=red]{x^2 + 16};,
      \addplot[color=blue]{-x^2 - 16};,
    \end{axis}
  \end{tikzpicture}
  \caption{Example of a quadratic function with no roots.
	   The red plot has the equation \( x^2 + 16 \).
	   The blue plot has the equation \( -x^2 - 16 \).}
  \label{fig:quadratic-no-roots}
\end{figure}

Links to this note