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.Powers

Description

 
Synopsis

Documentation

integrate :: Text -> Expression -> Maybe Expression Source #

Integrates powers of a variable. In other words, expressions of the form \(x^c\), where \(c\) is a constant.

>>> toHaskell . simplify <$> integrate "x" "x"
Just "1 / 2 * x ** 2"
>>> toHaskell . simplify <$> integrate "x" ("x" ** (1/2))
Just "(2 * x ** (3 / 2)) / 3"
>>> toHaskell . simplify <$> integrate "x" ("x" ** (-1))
Just "log x"