Private extension

Teach the calculation.
mathphp-explaining

A private extension that observes the same deterministic evaluator and turns each completed node into a useful, translatable lesson.

mathphp-explaining

Designed to load separately.

Keep mathphp/mathphp small and stable. This package adds its own contracts, translations, and presentation models without changing the public evaluator.

  • Post-order steps with dependencies
  • Substitutions, partial results, and exact spans
  • Closed-form analyzers for common equations and systems
  • Bounded numerical roots for any Core expression equality
  • ODE and bounded PDE analyzers with explicit scope
  • English and Danish translations
  • Custom observers without changing core semantics
Read integration notes ↗
Expression(5 × 2) × 2
  1. 1Multiply 5 by 25 × 2 = 1010
  2. 2Multiply the partial result by 210 × 2 = 2020
Final result20
// explain a scalar expression
$result = (new Explainer(Translations::create('en')))->explain('(5*2)*2');

// solve a mixed equation numerically
$roots = (new NumericalEquationAnalyzer())->analyze('sin(x) = x / 2', 'x', -8, 8);

Install from an approved source

These repositories are private and may be consumed through your organization’s Composer mirror or VCS access. Pin a tag or commit for production.

# add approved private VCS sources
composer config repositories.mathphp-visuals vcs https://github.com/mathphp/mathphp-visuals.git
composer config repositories.mathphp-explaining vcs https://github.com/mathphp/mathphp-explaining.git
composer require mathphp/mathphp-visuals:^0.3 mathphp/mathphp-explaining:^0.40
Access through GitHub Sponsors.Eligible personal monthly sponsors receive read access to the private add-ons. Check sponsor access →
What it adds
01

A teaching layer

Turn a single result into a sequence a learner can follow, with the operation, operands, translation key, and resulting value.

02

Closed-form analyzers

Explain linear, quadratic, power, system, calculus, matrix, area, root, and statistics operations with explicit result states.

03

General numerical solving

Sample any Core-compatible single-variable equality across a finite interval and expose every certified bracket, gap, and approximation.

How it fits

One core call.
One richer response.

01EvaluateCore parses and validates the expression.
02EnrichExplaining records each completed operation.
03PresentYour application chooses the UI, language, and renderer.
Feature guides