Polynomial Calculus
Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.
In this problem, we'll explore methods for computing symbolic derivatives and integrals of polynomials.
For this question, let's represent Polynomials in x (or any single variable)
as lists of coefficients,
starting with the zeroth-order coefficient. For example, we would represent
x^2 as [0, 0, 1]
and 4x^3 + 7x - 8 as [-8, 7, 0, 4]
.
Write a function calc_deriv
that computes the symbolic derivative of a polynomial given in this form. This relies heavily on the power rule, or the fact that the derivative is x^n is nx^{n-1}. We can perform the derivative on each term of the polynomial independently.
Also write a function calc_integral
to do the symbolic integration of polynomials. We'll represent polynomials in the same form we used above, and
like before we can use the power rule for integration on each term where x^n would have an integral of \frac{1}{n+1}x^{n+1}
Once you have simulated by hand and tested on your own machine, and are convinced that your program will do the right thing, upload your file below for testing:
Next Exercise: 2-D Arrays