6

Evaluate the following integral: $$\int\frac{\sqrt{x^2+2x+5}}{x^2-6x+5}\mathrm dx$$

Context: In my differential equations class, one of the questions we were given involved the integral $$\int\frac{\sqrt{x^2+1}}{x^2}\mathrm dx$$ My teacher evaluated it by rationalizing the numerator:

$$\int\frac{\sqrt{x^2+1}}{x^2}\mathrm dx$$ $$=\int\frac{x^2+1}{x^2\sqrt{x^2+1}}\mathrm dx$$ $$=\int\frac{\mathrm dx}{\sqrt{x^2+1}}+\int\frac{\mathrm dx}{x^2\sqrt{x^2+1}}$$

Now, it becomes doable. While going through this question, I started pondering about integrals of the type $\displaystyle\int\frac{\sqrt{Q_1}}{Q_2}\mathrm dx$ where $Q_1$ and $Q_2$ are quadratic functions in $x$. Hence, I took an example of such a form and thought of posting it on this site along with my approach, and inviting others' suggestions and strategies as well.


Kindly note that this is a self-answered post. Your comments and alternative methods are highly appreciated.

Integreek
  • 8,530
  • You could try letting $x = \frac{4u}{1-u^2}-1$, which leads to some nasty partial fraction decomposition and finding the antiderivative of some nicer rational expressions. – Accelerator Oct 18 '24 at 08:05
  • 1
    I have added context in my question, please tell me what other details I need to add(since this question has received a close vote for this reason). – Integreek Oct 18 '24 at 08:56
  • 2
    People vote to close posts for all kinds of reasons. Don't worry about it. What matters is that you show you're willing to put in the work and learn, which I can tell is true based on your answer below. – Accelerator Oct 18 '24 at 09:02
  • 4
    I agree with the comment of @Accelerator. While your question is somewhat off the beaten track, and your question is not that well composed (i.e. you didn't state up front that it was a self-answer question, where you were inviting other approaches) I personally feel that your posting is a high quality question, specifically because you provided your own answer. – user2661923 Oct 18 '24 at 18:41
  • @Accelerator I got to $$2\text{sgn}(u^2-1)\int\frac{(u^2+1)^2}{(u^2-1)(u^2+2u-1)(3u^2+2u-3)}\mathrm du$$ from your substitution. Is partial fractions the only way to carry this further?! – Integreek Nov 20 '24 at 11:47
  • It seems to be the most efficient way based on what you have in the denominator. Is there a different method you have in mind? – Accelerator Nov 20 '24 at 14:25
  • @Accelerator I don’t think so there is another method. The denominator looks really messy. – Integreek Nov 20 '24 at 14:27
  • Correct. After partial fractions the first time, you should get four rational expressions: two of which you can do partial fractions again and the other two where they have an easy antiderivative. – Accelerator Nov 20 '24 at 14:33

5 Answers5

3

In general, assume $Q_1=x^2+b_1 x+c$ and $Q_2=x^2+b_2 x+c$. Then, the integral $\displaystyle\int\frac{\sqrt{Q_1}}{Q_2}\mathrm dx$ can be decomposed as $$ \int\frac{\sqrt{Q_1}}{Q_2}\mathrm dx=\int\frac{\mathrm dx}{\sqrt{Q_1}} + \int \frac{\mathrm dt_+ }{t_+^2- \frac{b_2-2\sqrt c}{b_2-b_1}} + \int \frac{\mathrm dt_- }{t_-^2 - \frac{b_2+2\sqrt c}{b_2-b_1}} $$ where the pair of the substituted variables are $\displaystyle t_\pm = \frac{x\pm \sqrt c}{\sqrt{Q_1}}$. So, the given example has the solution $$\int\frac{\sqrt{x^2+2x+5}}{x^2-6x+5}\mathrm dx = \tanh^{-1}\frac{x+1}{\sqrt{x^2+2x+5}}\\ \hspace{15mm}-\frac {\sqrt2}{\phi}\tanh^{-1}\frac{\sqrt2(x+\sqrt5)} {\phi \sqrt{x^2+2x+5}} -{\sqrt2}\phi\tanh^{-1}\frac{\sqrt2\phi(x-\sqrt5)} {\sqrt{x^2+2x+5}}+C\\ $$

Integreek
  • 8,530
Quanto
  • 120,125
1

Say $$\mathcal I=\int\frac{\sqrt{x^2+2x+5}}{x^2-6x+5}\mathrm dx$$ $$=\int\frac{x^2+2x+5}{(x-1)(x-5)\sqrt{x^2+2x+5}}\mathrm dx$$

Now, rewrite $x^2+2x+5$ as:

$$x^2+2x+5=A(x^2-6x+5)+B(x-1)+C(x-5)$$ $$\implies A=1, B=10, C=-2$$

So, $$\mathcal I=\int\frac{\mathrm dx}{\sqrt{(x+1)^2+4}}+10\int\frac{\mathrm dx}{(x-5)\sqrt{x^2+2x+5}}-2\int\frac{\mathrm dx}{(x-1)\sqrt{x^2+2x+5}}$$

Say $$\mathcal I_1=\int\frac{\mathrm dx}{(x-5)\sqrt{x^2+2x+5}}\text{ and }\mathcal I_2=\int\frac{\mathrm dx}{(x-1)\sqrt{x^2+2x+5}}$$ then $$\mathcal I=\sinh^{-1}\left(\frac{x+1}2\right)+10\mathcal I_1-2\mathcal I_2$$

Substitute $x-5=\frac1{t}$ in $\mathcal I_1$ and $x-1=\frac1{t}$ in $\mathcal I_2$:

$$\mathcal I_1=-\text{sgn}t\int\frac{\mathrm dt}{|t|\sqrt{\left(5+\frac1{t}\right)^2+2\left(5+\frac1{t}\right)+5}}$$ $$=\frac{-\text{sgn}t}{2\sqrt{10}}\int\frac{\mathrm dt}{\sqrt{\left(t+\frac3{20}\right)+\left(\frac1{20}\right)^2}}$$ $$=\frac{-\text{sgn}t}{2\sqrt{10}}\sinh^{-1}(20t+3)+C$$ $$=\frac{\text{sgn}(5-x)}{2\sqrt{10}}\sinh^{-1}\left(\frac{20}{x-5}+3\right)+C$$

$$\mathcal I_2=-\text{sgn}t\int\frac{\mathrm dt}{|t|\sqrt{\left(1+\frac1{t}\right)^2+2\left(1+\frac1{t}\right)+5}}$$ $$=\frac{-\text{sgn}t}{2\sqrt2}\int\frac{\mathrm dt}{\sqrt{\left(t+\frac14\right)+\left(\frac14\right)^2}}$$ $$=\frac{-\text{sgn}t}{2\sqrt2}\sinh^{-1}(4t+1)+C$$ $$=\frac{\text{sgn}(1-x)}{2\sqrt2}\sinh^{-1}\left(\frac4{x-1}+1\right)+C$$

$$\therefore\boxed{\int\frac{\sqrt{x^2+2x+5}}{x^2-6x+5}\mathrm dx=\sinh^{-1}\left(\frac{x+1}2\right)+\frac{\sqrt{10}\text{sgn}(5-x)}{2}\sinh^{-1}\left(\frac{20}{x-5}+3\right)+\frac{\text{sgn}(x-1)}{\sqrt2}\sinh^{-1}\left(\frac4{x-1}+1\right)+C}$$

Integreek
  • 8,530
1

$$ \int \frac{\sqrt{x^2+2 x+5}}{x^2-6 x+5} d x=\frac{1}{4} \int\left[\frac{\sqrt{(x+1)^2+4}}{x-5} d x-\int \frac{\sqrt{(x+1)^2+4}}{x-1} d x\right]=\frac{1}{4}(I_5-I_1), $$ where $$ \begin{aligned} I_k & =\int \frac{\sqrt{(x+1)^2+4}}{x-k} d x\\&=\int \frac{2 \cosh \theta}{\sinh \theta-k} \cdot 2 \cosh \theta d \theta, \quad \textrm{ where }x+1=2\sinh \theta \\ & =4 \int \frac{\sinh ^2 \theta-k^2+k^2+1}{\sinh \theta-k} d \theta \\ & =4 \int(\sinh \theta+k) d \theta+4\left(k^2+1\right) \int \frac{1}{\sinh \theta-k} d \theta\\&=4(\cosh \theta+k\theta+(k^2+1)J_k) \end{aligned} $$


$$ \begin{aligned} J_k & =\int \frac{1}{\frac{e^\theta-e^{-\theta}}{2}-k} d \theta \\ & =2 \int \frac{1}{e^\theta-e^{-\theta}-2 k} d \theta \\ & =2 \int \frac{e^\theta}{e^{2 \theta}-2 k e^\theta-1} d \theta \\ & =\frac{1}{\sqrt{k^2+1}} \int\left(\frac{e^\theta}{e^\theta-\alpha}-\frac{e^\theta}{e-\beta}\right) d \theta \\ & =\frac{1}{\sqrt{k^2+1}} \ln \left| \frac{e^\theta-\alpha}{e^\theta-\beta} \right |+C \\ & =\frac{1}{\sqrt{k^2+1}} \ln \left| \frac{\frac{1}{2}\left(x+1+\sqrt{x^2+2 x+5}\right)-\alpha}{\frac{1}{2}\left(x+1+\sqrt{x^2+2 x+5}\right)-\beta} \right |+C \end{aligned} $$ where $\alpha=k+\sqrt{k^2+1}$ and $\beta=k-\sqrt{k^2+1}.$

Hence $$ \begin{aligned} &\int \frac{\sqrt{x^2+2 x+5}}{x^2-6 x+5} d x \\= & \frac{1}{4}\left(I_5-I_1\right) \\ = & \frac{1}{4} \left[ 4 \sinh ^{-1} \frac{x+1}{2}+\sqrt{26} \ln \left|\frac{x-9 -2\sqrt{26} +\sqrt{x^2+2 x+5}}{x-9 +2\sqrt{26} +\sqrt{x^2+2 x+5}}\right| -\sqrt{2} \ln \left|\frac{x-1-2\sqrt 2+\sqrt{x^2+2 x+5}}{x-1+2\sqrt 2+\sqrt{x^2+2 x+5}}\right|\right]+C \end{aligned} $$

Lai
  • 31,615
1

$$ \int \frac{\sqrt{x^2+2 x+5}}{x^2-6 x+5} d x=\frac{1}{4} \int\left[\frac{\sqrt{(x+1)^2+4}}{x-5} d x-\int \frac{\sqrt{(x+1)^2+4}}{x-1} d x\right]=\frac{1}{4}(I_5-I_1), $$ where $$ \begin{aligned} I_k & =\int \frac{\sqrt{(x+1)^2+4}}{x-k} d x\\&=\int \frac{2 \cosh \theta}{\sinh \theta-k} \cdot 2 \cosh \theta d \theta, \quad \textrm{ where }x+1=2\sinh \theta \\ & =4 \int \frac{\sinh ^2 \theta-k^2+k^2+1}{\sinh \theta-k} d \theta \\ & =4 \int(\sinh \theta+k) d \theta+4\left(k^2+1\right) \int \frac{1}{\sinh \theta-k} d \theta\\&=4(\cosh \theta+k\theta+(k^2+1)J_k) \end{aligned} $$


$$ \begin{aligned} J_k & =\int \frac{1}{\frac{e^\theta-e^{-\theta}}{2}-k} d \theta \\ & =2 \int \frac{1}{e^\theta-e^{-\theta}-2 k} d \theta \\ & =2 \int \frac{e^\theta}{e^{2 \theta}-2 k e^\theta-1} d \theta \\& =2\int \frac{e^\theta}{\left(e^\theta-k\right)^2-(k^2+1)} d \theta \\ & =-\frac{2}{\sqrt{k^2+1}} \tanh ^{-1}\left(\frac{e^\theta-k}{\sqrt{k^2+1}}\right) \\ & =-\frac{2}{\sqrt{k^2+1}} \tanh ^{-1}\left(\frac{\cosh \theta+\sinh \theta-k}{\sqrt{k^2+1}}\right) \\ & =-\frac{2}{\sqrt{k^2+1}} \tanh ^{-1}\left(\frac{\sqrt{x^2+2 x+5}+x+1-2 k}{2 \sqrt{k^2+1}}\right) \end{aligned} $$

Hence $$ \begin{aligned} &\int \frac{\sqrt{x^2+2 x+5}}{x^2-6 x+5} d x \\= & \frac{1}{4}\left(I_5-I_1\right) \\ \\=&\frac{1}{2}\left[2 \sinh ^{-1} \frac{x+1}{2}+\frac{1}{\sqrt{26}} \tanh ^{-1}\left(\frac{\sqrt{x^2+2 x+5}+x-9}{2 \sqrt{26}}\right)+\frac{1}{\sqrt{2}} \tanh ^{-1}\left(\frac{\sqrt{x^2+2 x+5}+x-1}{2 \sqrt{2}}\right)\right]+C \end{aligned} $$

Lai
  • 31,615
0

Another way to evaluate $\mathcal I_1$ and $\mathcal I_2$ in my previous answer is to perform the hyperbolic substitution $x+1=2\sinh t$:

$$\mathcal I_1=\int\frac{\mathrm dt}{\sinh t-3}$$ $$=2\int\frac{e^t\mathrm dt}{(e^{2t}-6e^t+9)-10}$$

Now, just substitute $e^t-3=u$ and then back substitute for $u$.

Similarly,

$$\mathcal I_2=\int\frac{\mathrm dt}{\sinh t-1}$$ $$=2\int\frac{e^t\mathrm dt}{(e^{2t}-2e^t+1)-2}$$

Now, it is obvious to put $e^t-1=u$ and then back substitute for $u$.

Integreek
  • 8,530