In class I sometimes go through the steps in mathematical derivations using Mathematica. Some of the steps involve substitutions and assumptions that come conceptually outside a strict mathematical derivation itself, but must be incorporated. One clear example is when deriving the equations governing Fraunhofer optical diffraction we assume that the distance to the screen is much larger than the size of the optical slit, i.e., $D \gg a$, or that we take only the first two terms in a Taylor series (so that an integral can be calculated).
Implementing most of these are fairly straightforward, for instance using /.
to perform a substitution, or limiting the number of terms in a Series
. Functions such as MultiplySides
and DivideSides
prove valuable as well.
I'd also like to process an integral so that all the constant terms (more specifically, the terms that do not depend upon the integration variable) are factored out and placed in front of the integral.
Here's a minimal example: Convert
$\int \frac{(\sin (\theta) + 2)\sqrt{x + a}}{2 x}\ dx \Rightarrow \frac{\sin (\theta) + 2}{2} \int \frac{\sqrt{x+a}}{x}\ dx$.
How do I do that algorithmically? The method should automatically know what the integration variable is, of course... I don't want to "hand enter" that information each time.
Such a function might be of the form:
ExtractConstants[ Integrate[...]]
(It should, of course, work on both definite and indefinite integrals.)
As far as I see it, the similar linked problems do not solve my problem fully but the below do.