11
$\begingroup$

Bug introduced in 13.1. and persisting through 14.0


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$
2
  • $\begingroup$ Did you report it? Just ran into into this bug in version 13.2.1 notebook $\endgroup$ Mar 7, 2023 at 19:49
  • $\begingroup$ @YaroslavBulatov no can you report it please. $\endgroup$
    – user13892
    Mar 7, 2023 at 21:43

1 Answer 1

12
$\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$
1
  • $\begingroup$ Using Leticia Block[Quiet ] tricks, it seems probably connected to Inverse functions are being used by Solve warning $\endgroup$ Feb 3 at 22:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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