Classes: Quadratic Functions

Create a class that can handle Quadratic functions.
Fig 1. Graph of y = x² + 2x - 8
Notes and Code Outcome

Specifications

Use the general equation: $$ y = a x^2 + b x + c \tag{1}$$ Required methods:
  1. Return the value of y for a given x (f(x)).
  2. Return the x coordinate of the vertex.
  3. Return the y coordinate of the vertex.
  4. Return both the x and y coordinates of the vertex.
  5. Return the y-intercept
  6. Find the zeros of the function (the x-intercepts: values of x where y = 0)
  7. Print out the equation like: y = x² + 2x - 8
  8. Draw the curve.
  9. Find the slope of the line at a given x value.

Test

Test your class using the equation: $$ y = x^2 + 2x - 8 $$

Test

Test your class using the equation: $$ y = x^2 + 2x - 8 $$

Output

Your program's output should look something like this:
Show Notes ▼

Area (by Integration)

  1. Add a method to find the area bounded by the curve and the x axis between two x values.
  2. Use the method to find the area bounded by x = 0 and x = 2 .

              The area under the curve between 0 and 2
                  is -9.333