Skip to content

Take the integral of a tree #1

Description

@n-arms

Description

We have syntax trees that we can evaluate, reduce (to some degree) and take the derivative of. It would be useful to be bale to take the integral of such a tree as well.

Implementation

The easiest way to do this would be via a recursive algorithm similar to the derivative algorithm. Some short cuts should be built in, to take the work off of the reduce call.

Math

It should be assumed that all of these an have any constant C added to them and remain valid:

  • ∫ k dx = kx
  • ∫ x dx = x^2/2
  • ∫ u(x)v(x) dx = u∫v dx - ∫u'(∫v dx) dx
  • ∫(u+v) dx = ∫u dx + ∫v dx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions