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

indefinite-integralsintegrationmathematicawolfram alpha

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?

Best Answer

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?

Related Question