4

I'm trying to find the antiderivative of $A(x)=\cos(x)\log(1+\cos(x))$

By using integration by parts I get :

$$\int A(x)\, dx = \sin(x)\ln(1+\cos(x))+\int \frac{\sin^2(x)}{1+\cos(x)} \\ =\sin(x)\ln(1+\cos(x))+\sin(x)\int \frac{\sin(x)}{1+\cos(x)}\\ =\sin(x) \ln(1+\cos(x))+\sin(x)(-\ln(1+\cos x))=0$$

However using formal calculator I find the antiderivative is $x+\sin(x)\ln(\cos(x)+1)-\sin(x)$. I do not see where is my mistake I applied $\int u'v \,dx=uv-\int uv'$ with $u'=\cos(x)$ and $v=\ln(1+\cos(x))$

Thank you

J126
  • 17,451
Tom
  • 65
  • 1
    Constant factors can be pulled out in front of the integral. Any function with the variable for which you are integrating can not. Thus, when you pulled $\sin(x)$ out, you made an error. – Alec Mar 02 '15 at 19:23
  • @Tom This is a great problem, particularly when you change the problem into a definite integral, integrating from pi/2 to pi – imranfat Mar 02 '15 at 21:03

2 Answers2

4

On the second line, you cannot pull the $\sin(x)$ in front of the integral. You should use $$ \sin^2(x)=1-\cos^2(x)=(1+\cos(x))(1-\cos(x)). $$

J126
  • 17,451
2

The mistake was the Integration of $\frac{sin^2 (x)}{1+cos(x)}$. Use $sin^2(x)=1-cos^2(x)=(1-cos(x))(1+cos(x))$.

kryomaxim
  • 2,882