AngouriMath

Navigation

← Back to list of members

SolveAPolynomialTimesAnExponentialAndATrigonometric​(AngouriMath.​Entity,​AngouriMath.​Entity.​Variable)

 Method (no overloads)

Summary

A polynomial times an exponential times a sine or a cosine —
P(x) e^(a x) cos(b x) and its kin — integrated by the repeated by-parts that
this shape is the textbook case for, run out here rather than through the chain.

Remarks

e^x cos(x) came out and x e^x cos(x) did not. The polynomial by-parts
integrates its dv with by-parts switched off, and e^x cos(x) is answered
by nothing but by-parts — the cyclic one, where the integral comes back a
multiple of itself. So the outer integral was declined for want of the inner one.
Switching that flag on is not the fix, and this is measured. It buys these
integrands and takes x tan(x)^3 sec(x)^4 from 20 ms to 94 seconds to
decline — one test, the whole of a 76% slowdown in the calculus suite. The cost and
the gain both arrive on the second round, integrating the antiderivative the
first produced, so no size measure separates them: what separates them is whether the
search succeeds, and that is only known by running it.
https://github.com/asc-community/AngouriMath/issues/1265
So the family is named instead of searched for. int e^(a x)(c cos(b x) + d sin(b x))
dx
is closed:
e^(ax) [ (a c - b d) cos(bx) + (b c + a d) sin(bx) ] / (a^2 + b^2)
            
and it stays in the same shape, so integrating x^k against it by parts lowers
k by one and leaves the same shape again. That terminates in k + 1 steps
with no search at all, which is what makes this closed.
a = 0 and b = 0 are both admitted — a polynomial times a bare sine, or a
bare exponential — though those already came out, so what this adds is the two
together. Both zero is a polynomial and is declined, since it is the power rule's.
Asked, not volunteered:
#1265.
https://github.com/asc-community/AngouriMath/issues/718

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online