Saturday, June 4, 2016

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

analysis - Injection, making bijection

I have injection f:AB and I want to get bijection. Can I just resting codomain to f(A)? I know that every function i...