Monday, 27 October 2014

calculus - Evaluate intfrac1sinxcosxdx



Question: How to evaluate 1sinxcosxdx



I know that the correct answer can be obtained by doing:
1sinxcosx=sin2(x)sinxcosx+cos2(x)sinxcosx=tan(x)+cot(x) and integrating.




However, doing the following gets a completely different answer:
1sinxcosxdx=sinxsin2(x)cosxdx=sinx(1cos2(x))cosxdx.
let u=cosx,du=sinxdx; then
1sinxcosxdx=1(1u2)udu=1(1+u)(1u)udu=(1u12(1u)+12(1+u))du=ln|cosx|+12ln|1cosx|+12ln|1+cosx|+C



I tested both results in Mathematica, and the first method gets the correct answer, but the second method doesn't. Is there any reason why this second method doesn't work?


Answer



If I take the derivative of your second answer (call it g(x)), I get:
dgdx=sinxcosx+sinx2(1cosx)+sinx2(1+cosx)=sinx(1cos2x+12cosx(1+cosx)12cosx(1cosx))cosx(1cosx)(1+cosx)=sinx(1cos2x+12cosx+12cos2x12cosx+12cos2x)cosx(1cos2x)=sinxcosxsin2x=1cosxsinx.
So I'm not sure why Mathematica says the second method is not "the right answer".


No comments:

Post a Comment

real analysis - How to find limhrightarrow0fracsin(ha)h

How to find limh0sin(ha)h without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...