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.Polynomial.Solve

Description

This module supports deriving exact solutions to polynomial equations. It cannot derive solutions for all polynomials; it will only return those which it can.

Synopsis

Documentation

solve :: IndexedPolynomial -> Maybe [Expression] Source #

Derive the roots for the given polynomial. Only real roots are returned.

>>> map (toHaskell . simplify) <$> solve (2 * power 1 - 6)
Just ["3"]
>>> map (toHaskell . simplify) <$> solve (power 2 - 4)
Just ["2","-2"]

Returns Nothing if the function does not know how to derive the roots.