Help Solve $\int \sqrt{x^{2}+x-2}\,dx$ 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
 A: Using (after having completed the square)$$\frac{2}{3} \left(x+\frac{1}{2}\right)=\cosh(t)\implies x=\frac{3 }{2}\cosh (t)-\frac 12\implies dx=\frac{3 }{2}\sinh (t)$$
$$I=\int \sqrt{x^2+x-2}\,dx=\frac 94 \int \sinh (t) \sqrt{\sinh ^2(t)}\,dt$$ Using the double angle formula
$$\int \sinh^2 (t)\,dt=\frac{1}{4} \sinh (2 t)-\frac{1}{2}t+C$$
A: First, reduce to a simpler square root
\begin{align*}
\int \sqrt{x^2+x-2} dx &= \int \sqrt{\left(x+\frac{1}{2}\right)^2-\frac{9}{4}} \,dx = \\
&= \frac{3}{2}\int \sqrt{\frac{4}{9}\left(x+\frac{1}{2}\right)^2-1} \,dx = \\
&= \frac{3}{2}\int \sqrt{\left(\frac{2}{3}x+\frac{1}{3}\right)^2-1} \,dx = \\
&= \frac{9}{4}\int \sqrt{t^2-1} \,dt
\end{align*}
Then use this know result
\begin{align*}
I = \int \sqrt{t^2-1} \,dt &= t\sqrt{t^2-1} -\int t\frac{2t}{2\sqrt{t^2-1}} \,dt = \\
&= t\sqrt{t^2-1} -\int \frac{t^2-1+1}{\sqrt{t^2-1}} \,dt = \\
&= t\sqrt{t^2-1} -\int \sqrt{t^2-1} \,dt -\int \frac{1}{\sqrt{t^2-1}} \,dt= \\
&= t\sqrt{t^2-1} -\int \sqrt{t^2-1} \,dt -\operatorname{arccosh} t = \\
&= t\sqrt{t^2-1} -I -\operatorname{arccosh} t
\end{align*}
from which
\begin{align*}
I = \int \sqrt{t^2-1} \,dt &= \frac{1}{2}t\sqrt{t^2-1} -\frac{1}{2}\operatorname{arccosh} t +C = \\
&= \frac{1}{2}t\sqrt{t^2-1} -\frac{1}{2}\log\left(t+\sqrt{t^2-1}\right) +C
\end{align*}
Then come back to the original integral
\begin{align*}
& \int \sqrt{x^2+x-2} dx = \frac{9}{4}\int \sqrt{t^2-1} \,dt = \\
& \qquad = \frac{9}{8}t\sqrt{t^2-1} -\frac{9}{8}\log\left(t+\sqrt{t^2-1}\right) +C = \\
& \qquad = \frac{9}{8}\left(\frac{2}{3}x+\frac{1}{3}\right)\sqrt{\left(\frac{2}{3}x+\frac{1}{3}\right)^2-1} -\frac{9}{8}\log\left(\left(\frac{2}{3}x+\frac{1}{3}\right)+\sqrt{\left(\frac{2}{3}x+\frac{1}{3}\right)^2-1}\right) +C = \\
& \qquad = \frac{1}{4}(2x+1)\sqrt{x^2+x-2} -\frac{9}{8}\log\left(2x+1+2\sqrt{x^2+x-2}\right) +C \\
\end{align*}
A: Under the substitution $t=\sqrt{\frac{x+2}{x-1}}$, the two subdomains $x<-2$ and $x>1$ corresponds to $0<t<1$ and $t>1$, respectively. Thus, integrate the two cases separately
\begin{align}
\int\limits_{x<-2} \sqrt{x^{2}+x-2}\ dx=&-\int\limits_{0<t<1}\frac{18t^2}{(1-t^2)^3}dt=-\frac{9t(1+t^2)}{4(1-t^2)^2}+\frac94\tanh^{-1}t\\
\int\limits_{x>1} \sqrt{x^{2}+x-2}\ dx=&-\int\limits_{t>1}\frac{18t^2}{(t^2-1)^3}dt= \frac{9t(1+t^2)}{4(1-t^2)^2}-\frac94\coth^{-1}t
\end{align}
A: Another standard approach, set $t = x + \sqrt{x^2 +x -2}$, then
\begin{align*}
& (t -x)^2 = x^2 +x -2 \\
& t^2 -2tx = x -2 \\
& x = \frac{t^2 +2}{1 +2t} \\
& dx = 2\frac{t^2 +t -2}{(1 +2t)^2}dt \\
\end{align*}
moreover, express the square root in terms of $t$
\begin{align*}
\sqrt{x^2 +x -2} &= t - x = \\
& = t - \frac{t^2 +2}{1 +2t} = \\
& = \frac{t^2 +t -2}{1 +2t} \\
\end{align*}
Then
\begin{align*}
\int \sqrt{x^2 +x -2} \, dx &= \int \frac{t^2 +t -2}{1 +2t} \cdot 2\frac{t^2 +t -2}{(1 +2t)^2}dt = \\
&= 2\int \frac{(t^2 +t -2)^2}{(1 +2t)^3} dt = \\
&= \int \left(\frac{1}{4}t +\frac{1}{8} +\frac{81}{16}\cdot\frac{2}{(1 +2t)^3} -\frac{9}{8}\cdot\frac{2}{1 +2t} \right)dt = \\
&= \frac{1}{8}t^2 +\frac{1}{8}t -\frac{81}{32}\cdot\frac{1}{(1 +2t)^2} -\frac{9}{8}\log{(1 +2t)}  +C \\
\end{align*}
and this can be simplified, with some efforts, to
$$
\frac{1}{4}(2x+1)\sqrt{x^2+x-2} -\frac{9}{8}\log\left(2x+1+2\sqrt{x^2+x-2}\right) +C
$$
A: 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:

*

*The reduction formula:
$$\int\sec^\text{n}\left(\text{s}\right)\space\text{ds}=\frac{\sin\left(\text{s}\right)\sec^{\text{n}-1}\left(\text{s}\right)}{\text{n}-1}+\frac{\text{n}-2}{\text{n}-1}\int\sec^{\text{n}-2}\left(\text{s}\right)\space\text{ds}\tag6$$

*And:
$$\int\sec\left(\text{s}\right)\space\text{ds}=\ln\left|\tan\left(\text{s}\right)+\sec\left(\text{s}\right)\right|+\text{C}\tag7$$
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}
A: $$
\begin{aligned}
I &= \int{\sqrt{x^2 + x - 2}dx} = \int{\underbrace{\sqrt{x^2 + x - 2}}_{u}\underbrace{dx}_{dv}} = |\text{ integrating by parts }| = \\
&= x\sqrt{x^2+x-2}-\int{xd\sqrt{x^2+ x-2}} = \\
&= x\sqrt{x^2+x-2}-\int{x\frac{2x+1}{2\sqrt{x^2+x-2}}dx} = \\
&= x\sqrt{x^2+x-2}-\int{\frac{2\left(x^2+x-2\right)-\left(x-4\right)}{2\sqrt{x^2+x-2}}dx} = \\
&= x\sqrt{x^2+x-2}-\underbrace{\int{\sqrt{x^2+x-2}dx}}_{I} + \int{\frac{x-4}{2\sqrt{x^2+ x-2}}dx} \Leftrightarrow \\
2I &= x\sqrt{x^2+x-2} + \frac{1}{2}\underbrace{\int{\frac{2x+1}{2\sqrt{x^2+ x - 2}}dx}}_{\int{d\sqrt{x^2+ x-2}}=\sqrt{x^2+x-2}}-\frac{9}{4}\int{\frac{dx}{\sqrt{x^2+x-2}}} = \\
&= \left(x+\frac{1}{2}\right)\sqrt{x^2+x-2}-\frac{9}{4}\int{\frac{dx}{\sqrt{\left(x+\frac{1}{2}\right)^2-\frac{9}{4}}}} = \left|\text{ note that }dx = d\left(x+\frac{1}{2}\right)\right|=\\
&= \left(x+\frac{1}{2}\right)\sqrt{x^2+x-2}-\frac{9}{4}\int{\frac{d\left(x+\frac{1}{2}\right)}{\sqrt{\left(x+\frac{1}{2}\right)^2-\left(\frac{3}{2}\right)^2}}} = \left|\int{\frac{du}{\sqrt{u^2-a^2}}} = \ln\left|u+\sqrt{u^2-a^2}\right|\right|=\\
&= \left(x+\frac{1}{2}\right)\sqrt{x^2+x-2}-\frac{9}{4}\ln\left|\left(x+\frac{1}{2}\right)+\sqrt{\left(x+\frac{1}{2}\right)^2-\left(\frac{3}{2}\right)^2}\right| + C \Leftrightarrow \\
I &=\frac{1}{2}\left(x+\frac{1}{2}\right)\sqrt{x^2+x-2}-\frac{9}{8}\ln\left|\left(x+\frac{1}{2}\right)+\sqrt{x^2+x-2}\right| + C
\end{aligned}
$$
