SymbolicSolver
Applies a bounded set of exact transformations to one equation in one variable. Polynomial equations through degree four use closed-form formulas. Other recognized forms are solved by isolating and inverting elementary functions, exponentials, logarithmic sums, or a single square-root term. Unsupported input is reported by solve as
`unsolved`so a caller can select a different strategy.
This class is the symbolic strategy used by the ordinary solver; it is not a general proof procedure. Inverse-function results follow the symbolic forms implemented here, including parameterized families for direct trigonometric functions. The supplied Expression is retained, while Polynomial input is converted to its Expression representation.
Members
SymbolicSolver(input: string | Expression | Polynomial, v: ExpressionInput): SymbolicSolverConstructorCreates a symbolic solver for
`input = 0`.
UnexpectedInputError If
`v`is not a plain variable.
Parameters
| Name | Type | Description |
|---|---|---|
input | string | Expression | Polynomial | Polynomial or expression whose zeros are sought. |
v | ExpressionInput | Plain variable to solve for. |
Returns
cubic(coeffs: Expression[]): Expression[]MethodSolves
`coeffs[3]x^3 + coeffs[2]x^2 + coeffs[1]x + coeffs[0] = 0`with Cardano's formula.
Parameters
| Name | Type | Description |
|---|---|---|
coeffs | Expression[] | Four coefficients in ascending-power order. |
Returns
Expression[] — Three symbolic root expressions.
inputContainsFunction(): booleanMethodReturns whether any node in the configured input is a function call.
Returns
boolean
quadratic(coeffs: Expression[]): Expression[]MethodSolves
`coeffs[2]x^2 + coeffs[1]x + coeffs[0] = 0`symbolically.
Parameters
| Name | Type | Description |
|---|---|---|
coeffs | Expression[] | Three coefficients in ascending-power order. |
Returns
Expression[] — The two quadratic-formula roots.
quartic(coeffs: Expression[]): Expression[]MethodSolves a quartic from five ascending-power coefficients with Ferrari's method.
Parameters
| Name | Type | Description |
|---|---|---|
coeffs | Expression[] | Coefficients from the constant through fourth-degree term. |
Returns
Expression[] — Four symbolic root expressions.
solve(): { … }MethodAttempts polynomial formulas and then supported function transformations.
Returns
{ … } — An object containing `solutions` and, when the strategy cannot solve the equation, the original `unsolved` expression.
