2. Get experience working with symbols and symbolic expressions.
3. Define a simple symbolic integration function.
The formal definition of the polynomial data type you are to implement is as follows:
To implement the polynomial data type, implement the following constructors, selectors and predicates:
The only reduction rule you need to include is one where the coefficient of a term changes; multiply the appropriate numbers together instead of leaving the two numbers explicitly in the output polynomial. (No nested multiplication expressions.) See example below for an implicit illustration.
2. Now define the service operator integral which symbolically integrates a polynomial. It will not bother to add on an arbitrary constant as is usually done in math classes. This function should be straight-forward to write if you implement and use the constructors, selectors and predicates listed above, and use a cond special form to handle all the cases that must be treated.
Here is an example of how these functions should work:
> (define poly (make-sum (make-power 'x 2) (make-product 3 'x))) > poly ((x ** 2) + (3 * x)) > (integral poly) ((0.3333333333333333 * (x ** 3)) + (1.5 * (x ** 2)))(Depending on how you define integral you may get 1/3 instead of 0.3333333333333333. That will be acceptable.)
3. Submit the definitions of your twelve functions to the Automated Tester and click on the Confirm butten when you get a PASS.