I have this integral $\int \sqrt{x^{2}+x-2}\,dx=\int |x-1|\sqrt{\frac{x+2}{x-1}}\,dx$.
My textbook advices to use the substitution $t^{2}=\frac{x+2}{x-1}$.
Observation: This integral should be solvable without using integral of modules as it is placed before moduled function integrals chapter.
I did the substitution and i obtaind $-18\int \frac{{t^{2}}}{|(t^{2}-1)^{3}|}\,dt$ . At this point i thought that since the substitution has to be an invertible function, i may consider a restrinction to cancel the absolute value.
I checked on wolfram alpha both integrals but it gives different results. Wolfram solution: $$\int \sqrt{(x^2 + x - 2)}\,dx = \frac14 (2 x + 1) \sqrt{(x^2 + x - 2)} - \frac98 \log\left(2 \sqrt{(x^2 + x - 2)} + 2 x + 1\right) + c$$
Any help? The purpose of the exercise is to trasform the irrational function into a rational one and use the Hermite's equation to solve it
Well, we are trying to solve:
$$\mathcal{I}\left(x\right):=\int\sqrt{x^2+x-2}\space\text{d}x\tag1$$
First, complete the square:
$$\mathcal{I}\left(x\right)=\int\sqrt{\left(x+\frac{1}{2}\right)^2-\frac{9}{4}}\space\text{d}x\tag2$$
Substitute $\text{u}=x+\frac{1}{2}$:
$$\mathcal{I}\left(x\right)=\int\sqrt{\text{u}^2-\frac{9}{4}}\space\text{du}\tag3$$
Now, substitute $\text{u}=\frac{3\sec\left(\text{s}\right)}{2}$:
$$\mathcal{I}\left(x\right)=\frac{9}{4}\int\tan^2\left(\text{s}\right)\sec\left(\text{s}\right)\space\text{ds}\tag4$$
Now, write $\tan^2\left(\text{s}\right)=\sec^2\left(\text{s}\right)-1$:
$$\mathcal{I}\left(x\right)=\frac{9}{4}\cdot\left(\int\sec^3\left(\text{s}\right)\space\text{ds}-\int\sec\left(\text{s}\right)\space\text{ds}\right)\tag5$$
Now, you can use:
So, you will get:
\begin{equation} \begin{split} \mathcal{I}\left(x\right)&=\frac{9}{4}\cdot\left(\int\sec^3\left(\text{s}\right)\space\text{ds}-\int\sec\left(\text{s}\right)\space\text{ds}\right)\\ \\ &=\frac{9}{4}\cdot\left(\frac{\sin\left(\text{s}\right)\sec^{3-1}\left(\text{s}\right)}{3-1}+\frac{3-2}{3-1}\int\sec^{3-2}\left(\text{s}\right)\space\text{ds}-\int\sec\left(\text{s}\right)\space\text{ds}\right)\\ \\ &=\frac{9}{4}\cdot\left(\frac{\sin\left(\text{s}\right)\sec^2\left(\text{s}\right)}{2}+\frac{1}{2}\int\sec\left(\text{s}\right)\space\text{ds}-\int\sec\left(\text{s}\right)\space\text{ds}\right)\\ \\ &=\frac{9}{4}\cdot\left(\frac{\sin\left(\text{s}\right)\sec^2\left(\text{s}\right)}{2}-\frac{1}{2}\int\sec\left(\text{s}\right)\space\text{ds}\right)\\ \\ &=\frac{9}{4}\cdot\left(\frac{\sin\left(\text{s}\right)\sec^2\left(\text{s}\right)}{2}-\frac{1}{2}\cdot\ln\left|\tan\left(\text{s}\right)+\sec\left(\text{s}\right)\right|+\text{C}\right)\\ \\ &=\frac{9}{8}\cdot\left(\sin\left(\text{s}\right)\sec^2\left(\text{s}\right)-\ln\left|\tan\left(\text{s}\right)+\sec\left(\text{s}\right)\right|+\text{C}\right)\\ \\ &=\frac{9\left(\sin\left(\text{s}\right)\sec^2\left(\text{s}\right)-\ln\left|\tan\left(\text{s}\right)+\sec\left(\text{s}\right)\right|\right)}{8}+\text{C} \end{split}\tag8 \end{equation}