<s>[INST] 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.
 [/INST] 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}$$
</s>