<s>[INST] Find $\int_0^\frac{\pi}{2} \frac {\theta \cos \theta } { \sin \theta + \sin ^ 3 \theta }\:d\theta$ My Calc 2 teacher wasn't able to solve this:
$$\int_0^\frac{\pi}{2} \frac {\theta \cos \theta  } { \sin \theta + \sin ^ 3 \theta }\:d\theta$$
Can someone help me solve this?
 [/INST] First Start with Basic Integration by Parts:
$$ \int_0^{\frac{\pi}{2}}\dfrac{x \cos x}{\sin{x}+\sin^3 x}\, dx = -\frac{\pi}{4}\log 2 - \int_0^{\frac{\pi}{2}} \left( \log{\sin{x}} - \frac{\log(1+\sin^2 x)}{2}\, dx \right) $$
$$$$

Since,
  $$\int_0^{\frac{\pi}{2}} \log\sin x\, dx = -\frac{\pi}{2} \log 2 $$
$$\therefore\int_0^{\frac{\pi}{2}}\frac{x \cos x}{\sin x+\sin^3 x} \, dx = \frac{\pi}{4} \log 2 + \int_0^{\frac{\pi}{2}} \frac{\log(1+\sin^2 x)}{2}\, dx \tag 1$$

$$$$

Now, let (for some $k$):
  $$I(k) = \int_0^{\frac{\pi}{2}} \frac{\log(1+\sin^2 x + k \sin^2 x)}{2}\, dx \tag 2$$

In order to find $I(k)$:
$$\frac{\partial I}{\partial k} = \int_0^{\frac{\pi}{2}} \frac{\sin^{2}{x}\, dx}{1+\sin^2 x +k\, \sin^2 x} $$
$$\implies I'(k) = \int_0^{\frac{\pi}{2}} \frac{1}{k+1}\left(1-\frac{\sec^2 x}{1+(k+2)\tan^2 x}\right)\, \, dx $$
$$=\frac{x}{k+1}-\frac{\tan^{-1}{(\sqrt{k+2}\,\tan x)}}{(k+1)\, \sqrt{k+2}}\bigg|_0^{\frac{\pi}{2}} = \frac{\pi}{2k+2}\left(1-\frac{1}{\sqrt{k+2}}\right)$$

Now just integrate (using Calculus 1 knowledge):
  $$I(k)= \frac{\pi}{2}\left(\log{(k+1)}-\log\left(\frac{\sqrt{k+2}-1}{\sqrt{k+2}+1}\right)\right)+C=\frac{\pi}{2}\, \log\left(2\, (\sqrt{k+2}+1)^2\right)+C$$
$$\therefore I(k) = \frac{\pi}{2}\, \log{\left(2 (\sqrt{k+2}+1)^2\right)}+C \tag 3$$

From this step forward, we will solve for $C$:
To find $C$, substitute $k=-1$. 
From $(2)$, we have:
$$\therefore I(-1) = 0$$
From $(3)$, we have: 
$$I(-1) = \frac{3\,\pi}{2}\log 2+C$$
$$\implies C= - \frac{3\,\pi}{2}\log 2$$
$$\therefore I(0) = \int_0^{\frac{\pi}{2}} \log(1+\sin^{2}{x})\, dx = \frac{\pi}{2}\, \log\left(2\, (\sqrt{2}+1)^2\right) - \frac{3\,\pi}{2} \log 2$$
Now use $(1)$:
$$\therefore\int_0^{\frac{\pi}{2}}\frac{x \cos x\, dx}{\sin x +\sin^3 x} = \frac{\pi}{4}\,\log 2 + \frac{\pi}{4}\, \log\left(2\, (\sqrt{2}+1)^2\right) - \frac{3\,\pi}{4}\log 2$$
$$= \frac{\pi}{4}\log\left(\frac{3+2\,\sqrt{2}}{2}\right)$$
</s>