Integral $\int {t+ 1\over t^2 + t - 1}dt$ 
Find : $$\int {t+ 1\over t^2 + t - 1}dt$$

Let $-w, -w_2$ be the roots of $t^2 + t - 1$.
$${A \over t + w} + {B \over t+ w_2} = {t+ 1\over t^2 + t - 1}$$
I got $$A = {w - 1\over w - w_2} \qquad B = {1- w_2\over w - w_2}$$
$$\int {t+ 1\over t^2 + t - 1}dt = A\int {1\over t+ w} dt + B\int {1 \over t+w_2}dt \\=  {w - 1\over w - w_2} \ln|t + w| + {1- w_2\over w - w_2}\ln|t + w_2| + C $$
After finding the value of $w, w_2$ final answer I got is 
$${\sqrt{5} + 1\over 2\sqrt{5}}\ln|t + 1/2 - \sqrt{5}/2| + {\sqrt{5} - 1 \over 2\sqrt{5}}\ln|t + 1/2 + \sqrt{5}/2| + C$$
But the given answer is :
$$\bbox[7px,Border:2px solid black]{ \frac{\ln\left(\left|t^2+t-1\right|\right)}{2}+\frac{\ln\left(\left|2t-\sqrt{5}+1\right|\right)-\ln\left(\left|2t+\sqrt{5}+1\right|\right)}{2\cdot\sqrt{5}}+C}$$
Where did I go wrong ? especially that first term of the answer is a mystery to me.
 A: Note that we have
$$\begin{align}
& {\sqrt{5} + 1\over 2\sqrt{5}}\log|t + 1/2 - \sqrt{5}/2| + {\sqrt{5} - 1 \over 2\sqrt{5}}\log|t + 1/2 + \sqrt{5}/2| + C\\[10pt]
&=  \frac12\log\left(|t + 1/2 - \sqrt{5}/2|\,|t + 1/2 + \sqrt{5}/2|\right)\\[10pt]
&{}+\frac{1}{2\sqrt{5}}\left(\log\left(|t + 1/2 - \sqrt{5}/2|\right)-\log\left(|t + 1/2 + \sqrt{5}/2|\right)\right)+C\\\\
&=\frac12\log\left(|t^2+t+1|\right)+\frac{1}{2\sqrt{5}}\left(\log\left(|t + 1/2 - \sqrt{5}/2|\right)-\log\left(|t + 1/2 + \sqrt{5}/2|\right)\right)+C\\\\
\end{align}$$
A: To get to their answer more directly, you can write the integral as$$\frac 12\int \frac{2t+1}{t^2+t-1}dt+\frac 12\int\frac{1}{(t+\frac 12)^2-\frac 54}dt$$
$$=\frac 12 \ln|t^2+t-1|+\frac{1}{2\sqrt{5}}\ln\left|\frac{t+\frac 12-\frac{\sqrt{5}}{2}}{t+\frac 12+\frac{\sqrt{5}}{2}}\right|+c$$
A: Another approach would be to rewrite the integrand as
$$\int\frac{2 t+1}{2 \left(t^2+t-1\right)}\,dt+\int\frac{1}{2 \left(t^2+t-1\right)}\,dt$$
Then let $u=t^2+t-1$ such that $du=2t+1\, dt$ so the integral becomes
$$\frac 12 \int \frac 1u\,du+\frac 12\int\frac{1}{ \left(t^2+t-1\right)}\,dt \;=\; \frac {\ln(|t^2+t-1|)}2+\frac 12\int\frac{1}{ \left(t^2+t-1\right)}\,dt$$
Completing the square we get $t^2+t-1 \,=\, (t+\frac 12)^2-\frac 54$ so we let $v=t+\frac 12$ such that $dv=dt$ and we get 
$$\begin{align}
\frac {\ln(|t^2+t-1|)}2+\frac 12 \int \frac 1{v^2-\frac 54}\,dv &\;=\;\frac {\ln(|t^2+t-1|)}2+\frac{\ln \left(|\sqrt{5}-2 v|\right)-\ln \left(|2 v+\sqrt{5}|\right)}{2\sqrt{5}}\\
& \;=\;\frac {\ln(|t^2+t-1|)}2+\frac{\ln \left(|\sqrt{5}-2 t+ 1|\right)-\ln \left(|2 t+ 1+\sqrt{5}\right|)}{2\sqrt{5}}+C\\
\end{align}$$
A: Here's an alternate method: we have $$I = \int \frac{t+1}{t^2+t-1}dt$$
Note that $\frac{d}{dt}(t^2+t-1) = 2t+1$
Then write $$2I = \int  \frac{2t+1}{t^2+t-1} +\frac{1}{t^2+t-1}dt$$
$$2I = \ln|t^2+t-1|+\underbrace{\int \frac{1}{(t+\frac{1}{2})^2-\frac{5}{4}} dt}_{J}$$
Note that $$\frac{1}{(t+\frac{1}{2})^2-\frac{5}{4}}= \frac{1}{(t+\frac{1}{2}+\frac{\sqrt{5}}{2})(t+\frac{1}{2}-\frac{\sqrt{5}}{2})} = \frac{A}{t+\frac{1}{2}+\frac{\sqrt{5}}{2}}+\frac{B}{t+\frac{1}{2}-\frac{\sqrt{5}}{2}}$$
Then $A(t+\frac{1}{2}-\frac{\sqrt{5}}{2})+B(t+\frac{1}{2}+\frac{\sqrt{5}}{2})=1$
$t=-\frac{1}{2}+\frac{\sqrt{5}}{2}\implies B=\frac{1}{\sqrt{5}},\quad t=-\frac{1}{2}-\frac{\sqrt{5}}{2}\implies A=-\frac{1}{\sqrt{5}}$
$$J = \frac{1}{\sqrt{5}}\int -\frac{1}{t+\frac{1}{2}+\frac{\sqrt{5}}{2}}+\frac{1}{t+\frac{1}{2}-\frac{\sqrt{5}}{2}} dt = \frac{1}{\sqrt{5}}\bigg(\ln|t+\frac{1}{2}-\frac{\sqrt{5}}{2}|-\ln|t+\frac{1}{2}+\frac{\sqrt{5}}{2}|\bigg)+C$$
Then $$I = \frac{1}{2}\ln|t^2+t-1|+\frac{1}{2\sqrt{5}}\bigg(\ln\bigg|t+\frac{1}{2}-\frac{\sqrt{5}}{2}\bigg|-\ln\bigg|t+\frac{1}{2}+\frac{\sqrt{5}}{2}\bigg|\bigg)+C$$ 
