try_table_lookup

Function try_table_lookup 

Source
pub fn try_table_lookup(expr: &Expression, var: &Symbol) -> Option<Expression>
Expand description

Try to integrate expression using table lookup

§Arguments

  • expr - The expression to integrate
  • var - The variable of integration

§Returns

Some(integrated_expression) if pattern matches, None otherwise

§Examples

use mathhook_core::calculus::integrals::table::try_table_lookup;
use mathhook_core::{Expression, symbol};

let x = symbol!(x);
let expr = Expression::pow(Expression::symbol(x.clone()), Expression::integer(2));
let result = try_table_lookup(&expr, &x);
assert!(result.is_some());