Mathematica is able to solve the indefinite integral


analytically for $b>a>0$, but the resulting $\arctan$ terms are too complicated for the next steps I need to perform. I assume these $\arctan$ terms are the result of Weierstrass substitution, so I am wondering if this integral can be evaluated in a different way, maybe by substitution, so there are no complicated $\arctan$ terms in the result?



It looks much better if you write $$\int\log(a\sin(2x)+b)\cos(x)\,dx=$$ $$\int\log(\sin(2x)+(c^2-1))\cos(x)\,dx+\log(a)\int \cos(x)\,dx$$ with $c^2-1=\frac b a$ specifying $c>1$ and using the FullSimplify command.

Simplifying the arctangents and the logarithms, you should end for the first integral with $$-\sqrt{c^2-2} \tan ^{-1}\left(\frac{\sqrt{c^2-2} (\sin (x)+\cos (x)+1)}{2-c^2+\sin(x)+\cos (x)}\right)+$$ $$\frac c 2 \log \left(-\frac{c+\sin (x)-\cos (x)}{c-\sin (x)+\cos (x)}\right)+\sin (x) \left(\log \left(c^2+\sin (2 x)-1\right)-2\right)$$

  • $\begingroup$ Wow good god that's terrible. I'm shocked there's a simple closed form solution for this integral. $\endgroup$ Feb 25 '21 at 4:21
  • $\begingroup$ @CameronWilliams. The OP already told that the antiderivative exists. The remaining was just to get rid of $a$, look at the result and find $c^2-1=\frac b a$. Not much work. Cheers :-) $\endgroup$ Feb 25 '21 at 4:25
  • $\begingroup$ Thanks @ClaudeLeibovici, this is great! Why do you set $c^2-1=\frac{b}{a}$? I don't see immediately how that helps... as an aside, is there a good way to manipulate terms of the form $a\arctan(x)+b\arctan(y)=c\arctan(z)$ and similar ones? it would be nice to convert the two antiderivatives (the original from Mathematica and the one you came up with) into one another directly, without manipulating the integrand. Thanks again! $\endgroup$
    – Minow
    Feb 25 '21 at 5:18
  • $\begingroup$ @Minow. May be, you could accept it as an answer (clicking the green arrow). It could be useful for other users to know it. $\endgroup$ Feb 25 '21 at 5:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.