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

Function trigArgMonomialExponent

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

For a trig argument `arg`: the exponent k if `arg = c + d·xᵏ` (x-free c, one * x-monomial term), else null.

(
  arg: Expression,
  x: string
)

Source from the content-addressed store, hash-verified

3793 * the SAME registered base/exponent, so they are consistent. */
3794export function functionOfExponentialSubstitution(
3795 u: Expression,
3796 x: string
3797): { v: Expression; g: Expression } | null {
3798 const st: FoeState = { base: null, expon: null, flag: false };
3799 if (!foeTest(u, x, st) || st.base === null || st.expon === null) return null;
3800 const ce = u.engine;
3801 return {
3802 v: ce.function('Power', [st.base, st.expon]),
3803 g: foeFunctionAux(u, x, st),
3804 };
3805}
3806
3807/** True iff every Sinh/Cosh subterm of `u` has an argument that is a polynomial
3808 * in x. The Chapter-6 exponential expansion is only a valid closed form when
3809 * the hyperbolic arguments are polynomial (so each `∫ poly·e^(poly)` resolves
3810 * via the Chapter-2 rules); a rational argument like `Sinh[(a+b·x)/(c+d·x)]`
3811 * integrates to a CoshIntegral the expansion cannot produce, so the fallback
3812 * must decline it. */

Callers 1

walkFunction · 0.85

Calls 2

xPowerExponentFunction · 0.85
hasMethod · 0.65

Tested by

no test coverage detected