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

Symtegration.Integration.Parts

Description

 
Synopsis

Documentation

integrate Source #

Arguments

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

Integration algorithms to try on the parts.

-> Text

Symbol for the variable.

-> Expression

Expression to integrate.

-> Maybe Expression

Integral, if derived.

Integrates by parts.

Specifically, if for

\[ \int f g \, dx \]

it is the case that we can find \(F = \int f \, dx\) and \(\int F \frac{dg}{dx} \, dx\), then we can derive the integral as

\[ \int f g \, dx = F g - \int F \frac{dg}{dx} \, dx \]

>>> let directMethods = [Powers.integrate, Trigonometric.integrate]
>>> toHaskell . simplify <$> integrate directMethods "x" ("x" * cos "x")
Just "x * sin x + cos x"