Integral of $\int \frac{\cos x+\sin 2x}{\sin x}$ I am trying to find the integral of $$\int \frac{\cos x+\sin 2x}{\sin x}$$
$$\int \frac{\cos x}{\sin x} + \int \frac{\sin 2x}{\sin x}$$
$$\int  \tan x + \int \frac{\sin 2x}{\sin x}$$
I think I am suppose to have the integral of tanx memorized so I will put that to the side for now.
$$\int \frac{\sin 2x}{\sin x}$$
I do not know what to do with this since I can't make a u subsitution or anything else so I will just randomly use the double angle identity I have memorized.
$$\int \frac{2\sin x\cos x}{\sin x}$$
$$\int 2\cos x$$
$$2 \int \cos x$$
$$2\sin x + \int  \tan x$$
$$2\sin x + \ln|\sec x| + c$$
This is of course wrong.

Remember that $$\dfrac{\cos(x)}{\sin(x)} = \cot(x)$$ and not $\tan(x)$. An easier way to do $\int \dfrac{\cos(x)}{\sin(x)} dx$ is to do as follows. Hence, $$I = \int \dfrac{\cos(x)}{\sin(x)} dx.$$ Set $\sin(x) = t$, then we get $\cos(x) dx = dt$. Hence, $$I = \int\dfrac{dt}{t} = \log(t) + C = \log(\lvert \sin(x) \rvert) + C$$
Hence, your answer is $$2 \sin(x) + \log(\lvert \sin(x) \rvert) + C$$
