9
$\begingroup$

Consider the simple quadratic function:

ClearAll[f];
f[x_]:=x^2;

Now let's set up the two identical integrals:

integrals={
    IntegrateChangeVariables[Inactive[Integrate][f[x],{x,-a,0}],u,u==-x],
    Inactive[Integrate][f[x],{x,-a,0}]
}

$\left\{\int _0^a-u^2du,\int _{-a}^0x^2dx\right\}$

But I was expecting:

$\left\{\int _0^au^2du,\int _{-a}^0x^2dx\right\}$

Now let's evaluate to get the result:

Activate@integrals

$\left\{-\frac{a^3}{3},\frac{a^3}{3}\right\}$

Am I using the IntegrateChangeVariables incorrectly or there is a bug here?

$\endgroup$

1 Answer 1

9
$\begingroup$

Yes, it is bug. The integral should be $$ \int_{a}^{0}-u^{2}du $$ And not $$ \int_{0}^{a}-u^{2}du $$

Proof:

Integrating $\int_{-a}^{0}x^{2}dx$ using change of variable $u=-x$. Hence $\frac{du}{dx}=-1$ or $dx=-du$. When $x=-a$ then $u=a$. When $x=0$ then $u=0$. And $x^{2}$ becomes $u^{2}$.

Hence the new integral becomes

\begin{align*} \int_{-a}^{0}x^{2}dx & =\int_{a}^{0}u^{2}\left( -du\right) \\ & =-\int_{a}^{0}u^{2}du\\ & =-\left[ \frac{u^{3}}{3}\right] _{a}^{0}\\ & =-\left( 0-\frac{a^{3}}{3}\right) \\ & =-\left( -\frac{a^{3}}{3}\right) \\ & =\frac{a^{3}}{3} \end{align*} And not $-\frac{a^{3}}{3}$ as Mathematica says.

Please report to WRI.

This is still experimental. So expect some bugs in it.

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.