# Find $\int \csc^2(x) \,dx$

I did:

\begin{align} & \int \csc^2(x) \,dx \\ = {} &\int \left(\frac 1 {\sin(x)}\right)^2 \, dx\\ = {} & \int (\sin(x)^{-1})^2 \, dx\\ = {} & \int \sin(x)^{-2} \, dx\\ = {} & \frac{\sin(x)^{-1}}{-1} \cdot \int \sin(x) \\ = {} & -\frac{1}{\sin(x)}\cdot -\cos(x) \\ = {} & \cot(x) \end{align}

But the right answer is $-\cot(x)$. Where did it go wrong?

• I question how you went from the fourth to fifth line. – John Dec 4 '17 at 20:10
• @John I tried to apply a kind of chain rule. I suppose that's wrong... how would you solve this? – Mark Read Dec 4 '17 at 20:12
• math.stackexchange.com/questions/239808/… – K Split X Dec 4 '17 at 20:13
• @KSplitX Well $u$ sub is the chain rule for integration. – user223391 Dec 4 '17 at 20:15
• @KSplitX $u$ sub is literally the chain rule in reverse – user223391 Dec 4 '17 at 20:20

Observe that

$$\frac {1}{\sin^2 (x)}=-\frac {-\sin^2(x)-\cos^2 (x)}{\sin^2 (x)}$$

$$=-\frac {d}{dx}\frac {\cos (x)}{\sin (x)}$$

• how'd you get to step 2? – Mark Read Dec 4 '17 at 20:19
• @MarkRead $(u/v)'=(u'v-uv')/v^2$. – hamam_Abdallah Dec 4 '17 at 20:21

I was puzzled by this step: $$\int \sin(x)^{-2} \, dx = \frac{\sin(x)^{-1}}{-1} \cdot \int \sin(x) \,dx \text{ ?}$$ Then I realized you were trying to apply a sort of chain rule.

If you have something like $\displaystyle \int (5x+3)^{12} \,dx$ you can say that it's equal to $\dfrac{(5x+3)^{13}}{13}\cdot \dfrac 1 5$ and that's an application of the chain rule for differentiation. Or a bit more elaborately: $$\int(5x+4)^{12} \, dx = \int u^{12} \, \left(\frac{du} 5\right) = \frac{u^{13}}{13} \cdot \frac 1 5 + \text{constant}$$ and like all "$u$-substitutions" that is an application of the chain rule.

But consider this: $$\require{cancel} \xcancel{\frac d {dx} \left( \frac{\sin(x)^{-1}}{-1} \cdot \int\sin(x)\, dx \right) = \sin(x)^{-2} \cdot \sin(x)}$$ The problem is that you're multiplying two functions and then differentiating what you get, and for that you need the product rule. You can't just differentiate the two separately.

• Wow! I didn't you can do that. – user8277998 Dec 4 '17 at 21:36