Turion said:
@DeIdeal: I don't understand how you went from y(x) to y'(x). Are you just omitting some steps or did you do all that in 1 step?
Well, yeah, obviously you
could write out some more terms, but it's just straight-forward differentation:
By the product rule
\frac{\mathrm{d}}{\mathrm{dx}}(B\cos(2x)+A\sin(2x))xe^x=(\frac{\mathrm{d}}{\mathrm{dx}}(B\cos(2x)+A\sin(2x)))xe^x+(B\cos(2x)+A\sin(2x))\frac{ \mathrm {d}}{\mathrm{dx}}xe^x.
The first term is done with the derivatives of cosine and sine and the chain rule for "(2x)", product rule is again used for the second one, as well as the derivative of x and e
x:
=(-2B\sin(2x)+2A\cos(2x))xe^x+(B\cos(2x)+A\sin(2x))(x\frac{ \mathrm {d}}{\mathrm{dx}}e^x+e^x\frac{ \mathrm {d}}{\mathrm{dx}}x)
=(-2B\sin(2x)+2A\cos(2x))xe^x+(B\cos(2x)+A\sin(2x))(x+1)e^x
Then it's just rearranging
=(-2B\sin(2x)+A(x+1)\sin(2x)+2A\cos(2x)+B(x+1)\cos(2x))e^x
=((B+2A+Bx)\cos(2x)+(A-2B+Ax))\sin(2x))e^x
Were you able to follow this better? I don't know, to me it just seems more confusing to write out all the terms explicitly like this, it feels like it's easier to see "what's going on" from the more concise expression.
----
And you can quite easily figure out the derivative from initial expression in your head. This is how I did it for, I don't know, a "symmetric" function like this: the e
x will remain in the final expression. You have a linear combination of the "same" ("2x") sine and cosine, so the final answer will have them as well, and then there's only the x to worry about, which will differentiate to one or stay the same, so you have a 1st-order polynomial coefficient multiplying the sine and cosine, something of the form (Psin(2x)+Qcos(2x))e
x. The "xe
x"-part differentiates to give the coefficient (x+1) times Bcos(2x) or Asin(2x), while the cosines and sines differentiate to each other, so you'll get 2Bsin(2x) and 2Bcos(2x) and you'll just have to check the signs.
It looks really complicated when I type it out like this, but it's really quite quick to do, a
lot quicker than doing it step by step.
(Of course, I checked that everything was correct with Wolfram before posting :P)