f(x)

Polynomials

Your Progress in this Chapter

0%

0 / 12 units completed

Chapter Overview

Polynomial Differentiation and Integration

Section 2.3 of 65 min2 code examples

Polynomial Differentiation and Integration

Differentiation and integration of polynomials are fundamental operations in calculus, widely used in various engineering and scientific applications. In SepalSolver, we implement these operations for polynomials represented as arrays of coefficients.

1. Differentiation

The derivative of a polynomial P(x) = a_0 x^n + a_1 x^{n-1} + ... + a_n is obtained by applying the power rule to each term, resulting in P'(x) = n a_0 x^{n-1} + (n-1) a_1 x^{n-2} + ... + 0. In SepalSolver, we create a method that computes the derivative and returns a new polynomial.

.. Admonition:: Example 1 :

\cfrac{d}{dx}(3x^2 + 5x + 10) = 6x + 5

Example 1C#

1
2
3
4
Code is ready to run
OutputFrom the book
Derivative: [6, 5]

2. Integration

The indefinite integral of a polynomial is computed by applying the reverse of the power rule, resulting in ∫P(x)dx = (a_0/n+1)x^{n+1} + (a_1/n)x^n + ... + C, where C is the constant of integration. We implement this in SepalSolver to return a new polynomial representing the integral.

.. Admonition:: Example 2 :

\int(6x^2 + 4x + 2)dx + C = 2x^3 + 2x^2 + 2x + C

Example 2C#

1
2
3
4
5
Code is ready to run
OutputFrom the book
Integral: [2, 2, 2, 9]