Evaluate the integral:
$\int \frac{x-3}{x^{2}+2 x-4} d x$
$I=\int \frac{x-3}{x^{2}+2 x-4} d x$
As we can see that there is a term of $x$ in numerator and derivative of $x^{2}$ is also $2 x$. So there is a chance that we can make substitution for $x^{2}+2 x-4$ and I can be reduced to a fundamental integration.
As, $\frac{\mathrm{d}}{\mathrm{dx}}\left(\mathrm{x}^{2}+2 \mathrm{x}-4\right)=2 \mathrm{x}+2$
$\therefore$ Let, $x-3=A(2 x+2)+B$
$\Rightarrow x-3=2 A x+2 A+B$
On comparing both sides -
We have,
$2 \mathrm{~A}=1 \Rightarrow \mathrm{A}=1 / 2$
$2 A+B=-3 \Rightarrow B=-3-2 A=-4$
Hence,
$I=\int \frac{\frac{1}{2}(2 x+2)-4}{x^{2}+2 x-4} d x$
$\therefore I=\frac{1}{2} \int \frac{2 \mathrm{x}+2}{\mathrm{x}^{2}+2 \mathrm{x}-4} \mathrm{dx}-4 \int \frac{1}{\mathrm{x}^{2}+2 \mathrm{x}-4} \mathrm{dx}$
Now, $I=I_{1}-4 I_{2} \ldots .$ eqn 1
We will solve $I_{1}$ and $I_{2}$ individually.
$\mathrm{AS}, \mathrm{I}_{1}=\frac{1}{2} \int \frac{2 \mathrm{x}+2}{\mathrm{x}^{2}+2 \mathrm{x}-4} \mathrm{dx}$
Let $u=x^{2}+2 x-4 \Rightarrow d u=(2 x+2) d x$
$\therefore I_{1}$ reduces to $\frac{1}{2} \int \frac{d u}{u}$
Hence,
$\mathrm{I}_{1}=\frac{1}{2} \int \frac{\mathrm{du}}{\mathrm{u}}=\frac{1}{2} \log |\mathrm{u}|+\mathrm{C}\left\{\because \int \frac{\mathrm{dx}}{\mathrm{x}}=\log |\mathrm{x}|+\mathrm{C}\right\}$
On substituting value of $u$, we have:
$I_{1}=\frac{1}{2} \log \left|x^{2}+2 x-4\right|+C \ldots . .$ eqn 2
As, $I_{2}=\int \frac{1}{x^{2}+2 x-4} d x$ and we don't have any derivative of function present in denominator. $\therefore$ we will use some special integrals to solve the problem.
i) $\int \frac{1}{x^{2}-a^{2}} d x=\frac{1}{2 a} \log \left|\frac{x-a}{x+a}\right|+C$ ii) $\int \frac{1}{x^{2}+a^{2}} d x=\frac{1}{a} \tan ^{-1}\left(\frac{x}{a}\right)+C$
Now we have to reduce $I_{2}$ such that it matches with any of above two forms.
We will make to create a complete square so that no individual term of $x$ is seen in denominator.
$\therefore I_{2}=\int \frac{1}{x^{2}+2 x-4} d x$
$\Rightarrow I_{2}=\int \frac{1}{\left\{x^{2}+2(1) x+(1)^{2}\right]-4-(1)^{2}} d x$
Using: $a^{2}+2 a b+b^{2}=(a+b)^{2}$
We have:
$I_{2}=\int \frac{1}{(x+1)^{2}-(\sqrt{5})^{2}} d x$
$\mathrm{I}_{2}$ matches with $\int \frac{1}{\mathrm{x}^{2}-\mathrm{a}^{2}} \mathrm{dx}=\frac{1}{2 \mathrm{a}} \log \left|\frac{\mathrm{x}-\mathrm{a}}{\mathrm{x}+\mathrm{a}}\right|+\mathrm{C}$
$\therefore I_{2}=\frac{1}{2 \sqrt{5}} \log \left|\frac{x+1-\sqrt{5}}{x+1+\sqrt{5}}\right|+C \ldots$ eqn 3
From eqn 1:
$I=I_{1}-4 I_{2}$
Using eqn 2 and eqn 3:
$I=\frac{1}{2} \log \left|x^{2}+2 x-4\right|-4\left(\frac{1}{2 \sqrt{5}} \log \left|\frac{x+1-\sqrt{5}}{x+1+\sqrt{5}}\right|\right)+C$
$I=\frac{1}{2} \log \left|x^{2}+2 x-4\right|-\frac{2}{\sqrt{5}} \log \left|\frac{x+1-\sqrt{5}}{x+1+\sqrt{5}}\right|+C$