3. Write a program to evaluate a polynomial \[ p(x)=c_{n} x^{n}+c_{n-1} x^{n-1}+\cdots+c_{2} x^{2}+c_{1} x+c_{0} \] and its derivative at a given pointt. The input is the row vectorcof coefficients of the polynomial arranged from highest to lowest power, and the numbert, and the two outputs arep(t)andp′(t). Computep(t)by first computing the row véctor \[ \left[t^{n}, t^{n-1}, \ldots, t^{2}, t, 1\right] \] and combine that with the vectorcto get the result. Computep′(t)by computing the coefficients of the derivative polynomial from the vectorc, and then evaluating that polynomial in the same way. Include some tests that provide evidence that your code produces the correct results. Please give proper explanation and typed answer only.
3. Write a program to evaluate a polynomial \[ p(x)=c_{n} x^{n}+c_{n-1} x^{n-1}+\cdots+c_{2} x^{2}+c_{1} x+c_{0} \] and its derivative at a given pointt. The input is the row vectorcof coefficients of the polynomial arranged from highest to lowest power, and the numbert, and the two outputs arep(t)andp′(t). Computep(t)by first computing the row véctor \[ \left[t^{n}, t^{n-1}, \ldots, t^{2}, t, 1\right] \] and combine that with the vectorcto get the result. Computep′(t)by computing the coefficients of the derivative polynomial from the vectorc, and then evaluating that polynomial in the same way. Include some tests that provide evidence that your code produces the correct results.
Please give proper explanation and typed answer only.
Step by step
Solved in 2 steps