Exp class
Represents the exponential function e^x in mathematical expressions.
The exponential function is the inverse of the natural logarithm and is defined as e raised to the power of the operand, where e ≈ 2.718281828.
Example usage:
final x = Variable('x');
final expr = Exp(x); // e^x
final result = expr.evaluate({'x': 1}); // ≈ 2.718281828
// Differentiation: d/dx[e^f(x)] = f'(x) * e^f(x)
final derivative = expr.differentiate(); // e^x
// Integration: ∫e^x dx = e^x + C
final integral = expr.integrate(); // e^x
- Inheritance
-
- Object
- Expression
- Exp
- Available extensions
Constructors
- Exp(Expression operand)
- Creates an exponential expression e^operand.
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- operand → Expression
-
The operand of the exponential function.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
depth(
) → int -
Calculate the depth of the expression tree.
override
-
differentiate(
[Variable? v]) → Expression -
Differentiates the expression with respect to a variable.
override
-
evaluate(
[dynamic arg]) → dynamic -
Evaluates the expression for a given value of
x.override -
expand(
) → Expression -
Expands the expression, if applicable, and returns a new expanded expression.
override
-
getVariables(
) → Set< Variable> -
Retrieves the base variables present in the expression, effectively
decomposing composite variables into their constituent parts.
For instance, for an expression containing
x^2, it returnsx, and forx*y, it returns bothxandy.inherited -
getVariableTerms(
) → Set< Variable> -
Retrieves all variables present in the expression, including composite
variables like
x^2orx*y.override -
integrate(
) → Expression -
Integrates the expression with respect to a variable.
override
-
isIndeterminate(
dynamic x) → bool -
override
-
isInfinity(
dynamic x) → bool -
override
-
isPoly(
[bool strict = false]) → bool -
Checks if the expression is a polynomial.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
simplify(
) → Expression -
Simplifies the expression, if possible, and returns a new simplified expression.
override
-
simplifyBasic(
) → Expression -
Performs basic simplification (arithmetic, combining like terms).
inherited
-
size(
) → int -
Compute the size of the expression based on the number of nodes in its tree.
override
-
substitute(
Expression oldExpr, Expression newExpr) → Expression -
Replace a sub-expression or a variable with another expression.
override
-
toString(
) → String -
Returns the string representation of the expression.
override
Operators
-
operator %(
dynamic other) → Expression -
Modulo operator. Creates a Modulo expression.
inherited
-
operator *(
dynamic other) → Expression -
Multiply operator. Creates a Multiply expression.
inherited
-
operator +(
dynamic other) → Expression -
Add operator. Creates an Add expression.
inherited
-
operator -(
dynamic other) → Expression -
Subtract operator. Creates a Subtract expression.
inherited
-
operator /(
dynamic other) → Expression -
Divide operator. Creates a Divide expression.
inherited
-
operator ==(
Object other) → bool -
The equality operator.
override
-
operator ^(
dynamic other) → Expression -
Power operator. Creates a Pow expression.
inherited
-
operator unary-(
) → Expression -
Unary minus operator. Creates a Negate expression.
inherited