The Quadratic Equation
An application for solving second degree polynomials.
Introduction
- A second degree polynomial has the form y = ax2 + bx + c, where a,b, and c are real numbers, x is the independent variable, and y is the dependent variable.
- The graph of equations of these form is a porabola and can have two, one, or no solutions when y = 0.
- The quadratic equation gives us the 'zeroes' for these equations by using the coeficients a,b, and c.
Derivation of the Quadratic Equation
Using algebra we can set y=0 and solve for x in terms of the coeficients a, b, and c:
ax2 + bx + c = 0
x2 + (b/a)x + c/a = 0
(x + b/2a)2 - b2 /4a2 +c/a = 0
(x + b/2a)2 = b2 /4a2 - c/a
(x + b/2a)2 = (b2 - 4ac)/4a2
x + b/2a = +/-sqrt((b2 - 4ac)/4a2)
x = (-b +/-sqrt(b2 - 4ac))/2a
An Example
The derivation on the last slide gves us two roots:
- x1 = (-b -sqrt(b2 - 4ac))/2a
- x2 = (-b +sqrt(b2 - 4ac))/2a
By plugging in the correct coeficients we can find the solution to any second degree polynomial if it exists.
For Example:
2x2 + 3x - 1 = 0
a <- 2
b <- 3
c <- -1
x1 <- (-b -sqrt(b^2 - 4*a*c))/(2*a)
x2 <- (-b +sqrt(b^2 - 4*a*c))/(2*a)
y <- function(x){2*x^2+3*x-1}
data.frame("Root" = c(x1,x2), "Value" = c(y(x1),y(x2)))
## Root Value
## 1 -1.7807764 0
## 2 0.2807764 0
Conclussion
- My shiny app performs these calculations for coeficients input by user
- It uses these calculations to find the zeros for the coresponding second degree polynomial.
- It presents the solutions clearly and provides a graph of the polynomial centered around the zeros to help visualize the solution.
- The ease of use and simplicity of this app makes it ideal for finding the zeros of a second degree polynomial.