symtegration-0.4.0: Library for symbolic integration of mathematical expressions.
CopyrightCopyright 2024 Yoo Chung
LicenseApache-2.0
Maintainerdev@chungyc.org
Safe HaskellNone
LanguageGHC2021

Symtegration.Integration.Sum

Description

 
Synopsis

Documentation

integrate Source #

Arguments

:: [Text -> Expression -> Maybe Expression]

Functions for directly integrating each term.

-> Text

The variable being integrated over.

-> Expression

The expression being integrated.

-> Maybe Expression

The integral, if successful.

Integrate term by term and returns the sum, using direct methods on each term.

>>> import Symtegration.Integration.Powers qualified as P
>>> import Symtegration.Integration.Trigonometric qualified as T
>>> let f = "x" + sin "x"
>>> P.integrate "x" f
Nothing
>>> T.integrate "x" f
Nothing
>>> let g = integrate [P.integrate, T.integrate] "x" f
>>> toHaskell . simplify <$> g
Just "(-1) * cos x + 1 / 2 * x ** 2"