MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / buildMono

Function buildMono

src/compute-engine/rubi/rubi-utils.ts:2840–2850  ·  view source on GitHub ↗

Build `(coef·head[arg])^exp` (dropping a unit coefficient / exponent).

(
  ce: ComputeEngine,
  coef: Expression,
  head: string,
  arg: Expression,
  exp: Expression
)

Source from the content-addressed store, hash-verified

2838 const shifted = cofunctionShiftRec(ce, e, x);
2839 if (hasDesyncedTargetArgs(shifted)) return e; // within-pair arg desync: revert
2840 return shifted;
2841}
2842
2843// Reciprocal inert heads → negative power of their base cofunction: `csc→1/sin`,
2844// `sec→1/cos`. Unlike Mathematica Rubi — which keeps `csc`/`sec` as distinct
2845// inert heads and carries a full parallel family of `(b·csc)^n`/`(b·sec)^n`
2846// rules — this port routes reciprocal-head integrands through the sine/cosine
2847// POWER rules, which already handle negative exponents (`∫sin·cos^-5` closes
2848// but `∫sin·sec^5` did not, because `sec` is an opaque head no `(d·cos)^n`
2849// pattern matches). Rewriting the reciprocal to a negative power collapses
2850// products like `sin·csc^5 → sin^-4` and exposes `cos·csc^5 → cos·sin^-5` to
2851// the odd-power substitution, so the whole `(g cos)^p (a+b sin)^m (c+d sin)^n`
2852// (§4.1.2.2) and bare `∫csc^n`/`∫sec^n` families close. Value-preserving.
2853const RECIP_BASE: Record<string, string> = { csc: 'sin', sec: 'cos' };

Callers 1

unifyProductClausesFunction · 0.85

Calls 3

functionMethod · 0.65
isSameMethod · 0.65
mulMethod · 0.65

Tested by

no test coverage detected