Find $\frac{a+b}{ab}$ such that $\int_{-1/2}^{1/2} \cos x\ln\frac{1+ax}{1+bx}dx=0$ Let $f(x) = \cos(x) \ln\left(\frac{1+ax}{1+bx}\right)$ be integrable on $\left[-\frac{1}{2} , \frac{1}{2}\right]$. Let
$$\displaystyle \int_{-1/2}^{1/2}f(x)\operatorname{dx}=0$$
where $a$ and $b$ are real numbers and not equal. Find the value of $\frac{a+b}{a\cdot b}$.
At first I applied integration by parts but then it got even more complicated and I couldn't solve it. How can I solve this problem?
 A: For a start, note that when $a=-b$ we get $f(x) = -f(-x)$ since $\cos(x)$ is even and $\ln(\frac{1+ax}{1-ax}) = -\ln(\frac{1-ax}{1+ax})$. Thus, by symmetry of the integration domain, the integral evaluates to $0$. The value of $\frac{a+b}{ab}$ would therefore be zero.
Proving the opposite, i.e. that we must have $a=-b$, uses a similar idea. Note that
$$\int_{-1/2} ^{1/2} f(x) \mbox{dx} = 0 \quad \implies \int_{-1/2} ^{1/2} [f(x) + f(-x)] \mbox{dx} = 0.$$
You can easily see that the integrand on the right equals
$$ \cos(x) \ln\bigg(\frac{1-a^2x^2}{1-b^2x^2}\bigg)$$
by using that $\cos(x)$ is even and $\ln(u) + \ln(v) = \ln(uv)$. Now comes the nice part: if $a^2 \neq b^2$, then the logarithm is either always positive (when defined) or always negative, because its argument is either $<1$ or $>1$. But the cosine is always positive, so then the integral would not evaluate to zero. As such, we require $a^2 = b^2$, or $a=-b$.
Small comment: the integrability condition ensures that neither of the expressions $1-a^2x^2$, $1-b^2x^2$ can change sign on the domain.
A: To be zero the integral, $h(x)=\log \left(\frac{1+a x}{1+b x}\right)$ must be odd, thus
$$\log \left(\frac{1+a x}{1+b x}\right)=-\log \left(\frac{1-a x}{1-b x}\right)$$
$$\log \left(\frac{1+a x}{1+b x}\right)+\log \left(\frac{1-a x}{1-b x}\right)=0$$
$$\log\frac{1-a^2x^2}{1-b^2x^2}=0$$
$$1-a^2x^2=1-b^2x^2\to b=-a$$
since the problem says $a\ne b$.
$h(x)=-h(-x)\to b=-a$
Must be added that  $h(x)$ exists on $[-1/2,1/2]$ only if
$$\frac{1+a x}{1-a x}>0\to -2<a<2$$
A: Note that the log function in the integrand can be decomposed as a sum of odd and even ones
\begin{align}
\ln\frac{1+ax}{1+bx}& =\frac12\ln\frac{1+ax}{1-ax}-\frac12\ln\frac{1+bx }{1-bx} + \frac12 \ln\frac{1-a^2x^2}{1-b^2x^2} \\
& =\tanh^{-1}(ax)-\tanh^{-1}(bx) + \frac12 \ln\frac{1-a^2x^2}{1-b^2x^2}
\end{align}
where the odd functions $\tanh^{-1}()$ do not contribute to the integral and the even function has to vanish for the integral to vanish, i.e.
$$\ln\frac{1-a^2x^2}{1-b^2x^2} =0$$
which leads to $a=-b$, hence $\frac{a+b}{ab }=0$.
