Copyright | Copyright 2025 Yoo Chung |
---|---|
License | Apache-2.0 |
Maintainer | dev@chungyc.org |
Safe Haskell | None |
Language | GHC2021 |
Synopsis
- integrate :: [Text -> Expression -> Maybe Expression] -> Text -> Expression -> Maybe Expression
Documentation
:: [Text -> Expression -> Maybe Expression] | Integration algorithms to try after substitution. |
-> Text | Symbol for the variable. |
-> Expression | Expression to integrate. |
-> Maybe Expression | Integral, if derived. |
Integrates by substitution.
Specifically, if for
\[ \int f(g(x)) h(x) \, dx\]
it is the case that \(\frac{dg(x)}{dx} = h(x)\), then compute \(\int f(v) \, dv\) and substitute with \(v=g(x)\).
>>>
import Symtegration.Integration.Trigonometric qualified as Trigonometric
>>>
toHaskell <$> simplify <$> integrate [Trigonometric.integrate] "x" (sin ("a" * "x" + 1))
Just "(-1) * 1 / a * cos (1 + a * x)"