Skip to content

Indefinite integration for piecewise functions #4721

@sagetrac-pbutler

Description

@sagetrac-pbutler

It would be nice to be able to do indefinite integration of piecewise functions in Sage.

I've created a patch which does this. I have made the default behavior of the integral() function of a piecewise function be to return the indefinite integral, and the definite integral is returned only when definite=True is supplied.

sage: pw = Piecewise([[(0,1), x*2], [(1,2), x + 3]])
sage: pw.integral()
Piecewise defined function with 2 parts, [[(0, 1), x^2], [(1, 2), (x^2 + 6*x)/2 - 5/2]]
sage: pw.integral(definite=True)
11/2

CC: @mwhansen

Component: calculus

Issue created by migration from https://trac.sagemath.org/ticket/4721

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions