pub trait DerivativeWithSteps {
// Required method
fn derivative_with_steps(
&self,
variable: &Symbol,
order: u32,
) -> StepByStepExplanation;
}Expand description
Educational derivative operations trait
Required Methods§
Sourcefn derivative_with_steps(
&self,
variable: &Symbol,
order: u32,
) -> StepByStepExplanation
fn derivative_with_steps( &self, variable: &Symbol, order: u32, ) -> StepByStepExplanation
Compute derivative with step-by-step explanation
§Arguments
variable- The variable to differentiate with respect toorder- Order of derivative (1 for first derivative, 2 for second, etc.)
§Examples
use mathhook_core::{expr, symbol};
use mathhook_core::calculus::derivatives::DerivativeWithSteps;
let x = symbol!(x);
let expr = expr!(x ^ 3);
let explanation = expr.derivative_with_steps(&x, 1);
assert!(explanation.steps.len() >= 4);