A question about my solution of this integral $\int_{0}^{1} \frac{a^x-a}{a^x+a} dx$ So i had to solve this integral:
$$\int_{0}^{1} \frac{a^x-a}{a^x+a} dx$$
$a\in\mathbb{R^+}$
So first i used substitution:
$t=a^x+a \implies a^x=t-a $ 
$ dx= \frac{dt}{\ln(a)(t-a)}$
Then with partial fractions i got this:
$$\frac{1}{\ln a} \left(2 \int_{1+a}^{2a}\frac{1}{t}dt-\int_{1+a}^{2a}\frac{1}{t-a}dt \right)$$
And with that i just used the common integral and have  gotten this solution afterwards:
$$\frac{\ln(2a(1+a)^2)}{\ln a}$$
So i wonder if i did it right, at most the problem is with substitution but i think i did change bounds correctly, but any insight would be helpful.
Thank you in advance.
 A: May be, you could have started writing $$\int_{0}^{1} \frac{a^x-a}{a^x+a} dx=\int_{0}^{1} \frac{a^x+a-2a}{a^x+a} dx=\int_{0}^{1} dx-2a\int_{0}^{1} \frac{dx}{a^x+a}= 1-2a\int_{0}^{1} \frac{dx}{a^x+a}$$ Now, using your change of variable $$t=a^x+a \implies a^x=t-a\implies x=\frac{\log (t-a)}{\log (a)}\implies dx=\frac{dt}{(t-a) \log (a)}$$ makes (as you did) $$I=\int \frac{dx}{a^x+a}=\frac{1}{ \log (a)}\int \frac{dt}{t (t-a) }=\frac{1}{ a\log (a)}\int \left(\frac{1}{t-a}-\frac{1}{t} \right)dt=\frac{1}{ a\log (a)}\log\left(\frac{t-a}t\right)$$ and back to $x$ $$I=\frac{1}{ a\log (a)}\log\left(\frac{a^x}{a^x+a}\right)$$ Now, just use the bounds for $x$
A: I think it is the correct substitution. We have
$$\int_0^1\frac{a^x-a}{a^x+1}dx=\frac{1}{\ln a} \left(2 \int_{1+a}^{2a}\frac{1}{t}dt-\int_{1+a}^{2a}\frac{1}{t-a}dt\right)$$
But the answer seems to be incorrect. Indeed,
\begin{align}
&\;\frac{1}{\ln a} \left(2 \int_{1+a}^{2a}\frac{1}{t}dt-\int_{1+a}^{2a}\frac{1}{t-a}dt\right)\\
=&\;\frac{1}{\ln a}\Big[2\ln t-\ln (t-a)\Big]_{1+a}^{2a}\\
=&\;\frac{1}{\ln a}[2\ln2a-\ln a-2\ln(1+a)+\ln 1]\\
=&\;\frac{1}{\ln a}[2\ln2+\ln a-2\ln(1+a)]\\
=&\;\frac{\ln\left(\frac{4a}{(1+a)^2}\right)}{\ln a}\\
\end{align}
A: using a slightly different route:
$$
\frac{a^x-a}{a^x+a} = \frac{a^{x-1}-1}{a^{x-1}+1} =\frac{e^{(x-1)\log a} -1}{e^{(x-1)\log a} +1}
$$
set $u=(x-1)\log a$, then
$$
I=\int_0^1 \frac{a^x-a}{a^x+a} dx = \frac1{\log a}\int_{-\log a}^0 \frac{e^u-1}{e^u+1}du = \frac1{\log a}\int_{-\log a}^0 \tanh \frac{u}{2} \quad du \\
$$
this gives
$$
I = \frac2{\log a} \bigg[ \log \cosh \frac{u}{2}\bigg]_{-\log a}^0 \\
=  \frac1{\log a} \bigg[ \log \cosh^2 \frac{u}{2}\bigg]_{-\log a}^0 \\
=  \frac1{\log a} \bigg[ \log \frac{1+\cosh u}2 \bigg]_{-\log a}^0 \\
= \frac{\ln\left(\frac{4a}{(1+a)^2}\right)}{\ln a}\\
$$
A: hint: setting $$a^x=t+a$$ then we get$$x\ln(a)=t+a$$ and $$dx=\frac{1}{\ln(a)}dt$$
