Why is this integral of tan incorrect? Note: change all x on my 3rd and 4th comment apart from those on the very first line of the 3rd comment to z.
\[\int \frac{\sin(x)}{\cos(x)}dx=\int \frac{\sin(x) \cos(x)}{\cos^2(x)}dx=\int \frac{\sin(x) \cos(x)}{1-\sin^2(x)}dx\] \[z= \sin(x), dz=\cos(x)dx\] \[=\int \frac{z }{1-z^2}dz\] \[=\frac{-1}{2}\ln(-\cos(x))+k\]
I'll justify the end step:
\[\int \frac{x}{x+b} dx=-b \ln(x+b)+x\] \[-\int \frac{z}{z^2-1} dx=- \frac{1}{2} \left(\int \frac{zdz}{z-1} -\int \frac{zdz}{z+1} \right) dx\] \[=- \frac{1}{2} \left(-(-1) \ln(x+(-1))+x-(-(1) \ln(x+1)+x) \right) dx\] \[=- \frac{1}{2} \left(\ln(x-1))+x+\ln(x+1)-x \right) dx\] \[=- \frac{1}{2} \left(\ln(x-1))+\ln(x+1) \right) dx\] \[=- \frac{1}{2} \left(\ln(x-1)(x+1) )\right) dx\] \[=- \frac{1}{2} \left(\ln(x^2-1)\right) dx\]
\[=-\frac{1}{2}\ln(\sin^2(x)-1)=-\frac{1}{2}\ln(-\cos(x))\]
There are 2 minus signs that really shouldn't be there. Where did I make the mistake?
there must be cos^2x
Of course.
let me explain
By the way, I know the conventional way of integrating tan.
your first substitution is sinx, second is 1-z^2
Really? I think I just substituted once.
Sorry, I switched notation from \[z\] to \[x\] midway through. That was unintentional.
no there two substitutions
wait i'll write full form
Read everything on my third comment (except the very first line) as z.
\[\int\limits_{}\frac{ z }{ 1-z ^{2} }dz\]
u=1-z^2 du=-2z
\[-\frac{ 1 }{ 2 }\int\limits_{}\frac{ 1 }{ u }du\]
You misunderstand me, I'm perfectly aware how to do it that way: I'm more interested in seeing where my mistake was.
that equals \[-\frac{ 1 }{ 2 }\ln \left| u \right|=-\frac{ 1 }{ 2 }\ln \left| 1-z ^{2} \right|\]
z=sin^2
1-sin^2=cos^2
got it?
I already got it. You misunderstood me, I'm perfectly aware how to do it that way: I'm more interested in seeing where my mistake was.
your mistake was in partial fractions
it was incorrect
\[\frac{2}{(z-1)(z+1)}=-\frac{(z-1)}{(z-1)(z+1)}+\frac{(z+1)}{(z-1)(z+1)}=-\frac{1}{z+1}+\frac{1}{z-1}\]
That part?
the first part, when you just started to split it into to equations. It seems like that part (that you showed), but im sure there is a discrepancy
there was z instead of 2
No, the z was on both sides
I'm pretty sure that part was correct, it's probably because I forgot to take the absolute vale of cos^2 inside ln.
I'm still not sure why you have to take absolute values of the thing inside log
What's wrong with it being complex-valued?
yeah, seems your answer is also correct, don't forget that different method of solving integration may result in different answers
sorry, i was confused before
Join our real-time social learning platform and learn together with your friends!