# I need help on deriving this trig function.

I am trying to derive $e^x \sin x - 2x \csc x$. I tried using the product and difference rule. So I got the derivative for $e^x \sin x$ and got $(e^x)(\cos(x))+(\sin(x))(e^x)$ and for the derivative of $2x \csc x$ I got $(2(x))(-\csc(x) \cot(x))+2\csc(x)$. So now I used the difference rule and simplified and what not and I ended with $(e^x)(\cos(x)+\sin(x))-2x(-\csc(x)\cot(x))+2\csc(x)$. When I entered the answer it was wrong. The answer is $(e^x)(\cos(x)+\sin(x))+2(x \cot(x)-1)\csc(x).$

I would really appreciate if someone could point out what I did wrong and how to get the correct answer, step by step preferably so I know how to deal with this issue. All help is appreciated!

• Please check this out to make your post more readable. – DanZimm Jun 23 '14 at 22:01
• Thanks, I'll be sure to reference that next time. – Kenshin Jun 23 '14 at 22:05

\begin{align} &e^x(\cos x + \sin x) &&- [2x(- \csc x \cot x )+ 2 \csc x]\\ = &e^x(\cos x + \sin x) && - 2x(- \csc x \cot x ) \mathbf{-} 2 \csc x\\ = &e^x(\cos x + \sin x) && + 2x( \csc x \cot x ) \mathbf{-} 2 \csc x\\ = &e^x(\cos x + \sin x) && + 2 \csc x (x \cot x \mathbf{-} 1) \end{align}