Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the cubic equation: f(x)-ABr +ar+D. The inflections (turning points) of

ID: 3194937 • Letter: C

Question

Consider the cubic equation: f(x)-ABr +ar+D. The inflections (turning points) of the curve will occur where the deaivative ofjis zero. The locations of these zeros can be found by finding the roots (zeros) of the quadratic equation: g(x)-3Ax +2Bx+C that the roots of a general quadratic equation e(x) =ar +br + care: /b -4ac 2a 2a a. [6 points] Using the expressions above, write a MATLAB function that will take as input the coefficients A, B and C, and provide as output the locations of the turning points of f(x). Remember that there may be zero, one or two turning points, so your function will need to work intelligently for each case.

Explanation / Answer

r = roots(p) returns the roots of the polynomial represented by p as a column vector. Input pis a vector containing n+1 polynomial coefficients, starting with the coefficient of xn. A coefficient of 0 indicates an intermediate power that is not present in the equation.

For example, p = [3 2 -2] represents the polynomial 3x^2+2x2.

Lets first store the values of A,B, and C

A = input ('A')

B = input ('B')

C = input ('C')

p = [3A 2B C]

r = roots(p)

if isreal(p) ==0

disp('no point')

if isreal(p) ==1

disp(r)

disp(r_real)