roots

Function roots 

Source
pub fn roots(poly: &Expression, var: &Symbol) -> Expression
Expand description

Find polynomial roots

§Mathematical Definition

roots(p(x)) = {x : p(x) = 0}

§Arguments

  • poly - Polynomial expression
  • var - Variable to solve for

§Returns

Set of roots or symbolic expression

§Examples

use mathhook_core::functions::polynomials::polynomial_eval::roots;
use mathhook_core::{expr, symbol};

let x = symbol!(x);
let poly = expr!((x ^ 2) - 1);
let r = roots(&poly, &x);