\(\displaystyle \int_{0}^{2\pi }cos^{2}(nx)dx\)
Why If I solve the integral by parts I get an answer and if I solve by using formula I get another answer.What's wrong ?
By parts:
I take f(x)=cos^2(nx) so f'(x)=-nsin(2nx) and g'(x)=1 so g(x)=x
I obtain \(\displaystyle xcos^{2}(nx) +n\int_{0}^{2\pi }sin(2nx)dx\)
The second integral is 0 and when I replace in the first part with 0 and 2pi I get 2pi-0=2pi
On the other hand, if I use the formula cos^2(x)=(1+cos2x)/2 and integrate I get the response pi which is the right answer.
Why solving by parts doesn't work ?
Why If I solve the integral by parts I get an answer and if I solve by using formula I get another answer.What's wrong ?
By parts:
I take f(x)=cos^2(nx) so f'(x)=-nsin(2nx) and g'(x)=1 so g(x)=x
I obtain \(\displaystyle xcos^{2}(nx) +n\int_{0}^{2\pi }sin(2nx)dx\)
The second integral is 0 and when I replace in the first part with 0 and 2pi I get 2pi-0=2pi
On the other hand, if I use the formula cos^2(x)=(1+cos2x)/2 and integrate I get the response pi which is the right answer.
Why solving by parts doesn't work ?