Answer to Question #277976 in C++ for ackey_1

Question #277976

on function ax^2+bx+c ,Create the table on set of set of input x = [-4,-3,-2,-1,0,1,2,3,4]

2. Plot the graph i.e., parabola using the table created in part(i) .

3. Calculate the first derivative of the function .

4. Find the first derivative of the function and use that to evaluate the extreme value .

5. Using the second derivative , tell that the extreme value calculated is minima or maxima.


1
Expert's answer
2021-12-10T07:17:11-0500
#include <cmath.h>
#include <stdio.h>

double a, b, c;

double f(double x) {
  return a * x*x + b * x + c;
}

double derivative(double x) {
  return (f(x + 1e-6) - f(x - 1e-6)) / 2e-6;
}

int main() {
  printf("Enter coefficients of quad-equation: ");
  scanf("%d%d%d", &a, &b, &c);
  printf("First derivative x=1: %.2f", derivative(1));
}




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog