Why does Mathematica / Wolfram Alpha gives 2 different answers for these 2 queries?

129 Views Asked by At

I was assigned to find the integral of this expression:

$$ \int\frac{-5x^3+3x^\frac{3}{2}-2x^2-5x + \frac{3}{\sqrt x}}{x^2+1}\mathrm{d}x$$

I did:

$$ = \int\frac{-5x(x^2 + 1)}{x^2+1} \mathrm{d}x + \int\frac{ 3x^{-\frac{1}{2}}(x^2+1)}{x^2+1} \mathrm{d}x + \int\frac{-2x^2 - 2 + 2}{x^2+1}\mathrm{d}x$$

And continued on from there.

Apparently, Wolfram Alpha (offline Mathematica as well) gives 2 different answers to the following queries:

  1. Link:

$$ \int \frac{3 x^{3/2}+\frac{3}{\sqrt{x}}}{x^2+1} \, dx + \int\frac{-2 x^2}{x^2+1}dx$$

Which gives:

$$ 6 \sqrt{x}-2 \left(x-\tan ^{-1}(x)\right) $$

  1. Link:

$$ \int \left(\frac{3 x^{3/2}+\frac{3}{\sqrt{x}}}{x^2+1}-\frac{2 x^2}{x^2+1}\right) \, dx $$

Which gives:

$$ -2 \left(x-3 \sqrt{x}+\tan ^{-1}\left(\frac{1}{x}\right)\right) $$

Which are almost identical besides the usage of $1/x$ vs $x$ inside $tan^{-1}$ and it's sign. My way led me to the 1st solution.

Which solution is correct? Is there anything wrong with splitting the integrals like that?

3

There are 3 best solutions below

3
On BEST ANSWER

We can understand the problem here when we plot the two functions together $f(x) = 6*sqrt(x)-2*x+2*\arctan(x)$ and $g(x) = 6*sqrt(x)-2*x-2*\arctan(1/x)$

In the plot, using some specific range the two functions take the same path Check it

graph of the two functions

4
On

Did you try to graph both solutions to check if they are the same up to an additive constant? (That means parallel graphs.)

Did you try to differentiate both solutions to check if they are both antiderivatives?

0
On

Hints:

$\bullet \tan^{-1}(x) + \cot^{-1} x = \frac \pi2$

$\bullet\tan^{-1}(x) = \begin{cases}\cot^{-1}(\frac1x) &x>0\\ \cot^{-1}(\frac1x)-\pi &x<0\end{cases}$

$\bullet$ Indefinite integral represents a family of curves which vary by a constant.