Show solutionHide solution
We differentiate with respect to \(x\) the function
\[ y=\frac{e^x}{\sin x}. \]This is a quotient, so we use the quotient rule
\[ \left(\frac{u}{v}\right)'=\frac{u'v-uv'}{v^2}, \]with \(u=e^x\) and \(v=\sin x\). We have
\[\nu'=e^x,\qquad v'=\cos x. \]Therefore
\[ \frac{dy}{dx} =\frac{e^x\sin x-e^x\cos x}{\sin^2 x} =\frac{e^x(\sin x-\cos x)}{\sin^2 x}. \]This expression is valid wherever the original function is defined, that is, for all real \(x\) with \(\sin x\neq 0\), i.e. \(x\neq n\pi\) for integers \(n\).
Thus
\[ \boxed{\frac{d}{dx}\left(\frac{e^x}{\sin x}\right)=\frac{e^x(\sin x-\cos x)}{\sin^2 x},\qquad x\neq n\pi,\ n\in\mathbb{Z}.} \]