pub struct IntegrationMethods;Expand description
Integration methods collection
Implementations§
Source§impl IntegrationMethods
impl IntegrationMethods
Sourcepub fn by_parts(
expr: &Expression,
variable: Symbol,
) -> Result<Expression, MathError>
pub fn by_parts( expr: &Expression, variable: Symbol, ) -> Result<Expression, MathError>
Attempt integration by parts
Uses the IntegrationByParts module to attempt integration by parts.
§Errors
Returns MathError::NotImplemented if integration by parts cannot be applied
or if no antiderivative can be found.
§Examples
use mathhook_core::Expression;
use mathhook_core::symbol;
use mathhook_core::calculus::integrals::IntegrationMethods;
let x = symbol!(x);
let expr = Expression::mul(vec![
Expression::symbol(x.clone()),
Expression::function("exp", vec![Expression::symbol(x.clone())])
]);
let result = IntegrationMethods::by_parts(&expr, x);Sourcepub fn substitution(
expr: &Expression,
variable: Symbol,
) -> Result<Expression, MathError>
pub fn substitution( expr: &Expression, variable: Symbol, ) -> Result<Expression, MathError>
Attempt integration by substitution
Uses u-substitution to integrate composite functions f(g(x)) where the derivative g’(x) appears in the integrand.
§Errors
Returns MathError::NotImplemented if no suitable substitution can be found.
§Examples
use mathhook_core::{Expression, Symbol};
use mathhook_core::symbol;
use mathhook_core::calculus::integrals::IntegrationMethods;
let x = symbol!(x);
let expr = Expression::function("sin", vec![
Expression::pow(Expression::symbol(x.clone()), Expression::integer(2))
]);
let result = IntegrationMethods::substitution(&expr, x);Auto Trait Implementations§
impl Freeze for IntegrationMethods
impl RefUnwindSafe for IntegrationMethods
impl Send for IntegrationMethods
impl Sync for IntegrationMethods
impl Unpin for IntegrationMethods
impl UnsafeUnpin for IntegrationMethods
impl UnwindSafe for IntegrationMethods
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more