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 )
| 3793 | * the SAME registered base/exponent, so they are consistent. */ |
| 3794 | export 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. */ |
no test coverage detected