Second Order Differential Equation Assistance Hi Maths stack exchange!
I’m doing this question for homework,
$$y′′+4y′+4y=0$$
I managed to find the auxiliary equation. 
$$y=(A+Bx)e^{-2x}$$
The issue is when I was looking at the solutions of what to do next, it said this should be the next line.
$$y'(x)=Be^{-2x}+(-2)(A+Bx)e^{-2x}=(B-2A+Bx)e^{-2x}$$
I have no Idea how they got answer, I was wondering if anyone could shed some light on how this answer was obtained.
Thanks
~Neamus
 A: For differentiable functions $f,g,h:\mathbb R\rightarrow\mathbb R$ the product rule says that 
$$\frac{d}{dx}(fg)=(f')g+(g')f$$
Furthermore, the chain rule states that
$$\frac{d}{dx}g(h(x))=h'(x)\cdot g'(h(x))$$
Applying this to $f(x)=A+Bx,\, g(x)=e^x$ and $h(x)=-2x$ gives
$$y(x)=f(x)\cdot g(h(x))$$
Then 
$$y'(x)=f'(x)\cdot g(h(x))+f(x)\cdot h'(x)\cdot g'(h(x))$$
We have \begin{align}
f'(x)&=B \\
h'(x)&=-2 \\
g'(x)&=e^x
\end{align}
This gives you
$$y'(x)=Be^{-2x}+(A+Bx)(-2)e^{-2x}$$
A: You have the correct idea so far, they got that line by differentiation using the chain rule. If we take your progress so far $y(x)=(A+Bx)e^x$ and differentiate it with respect to $x$ we get: $$\frac{d}{dx}(y(x))=\frac{d}{dx}(Ae^{-2x}+Bxe^{-2x})=\frac{d}{dx}(Ae^{-2x})+\frac{d}{dx}(Bxe^{-2x})$$ From this we can split it into
$$\frac{d}{dx}(Ae^{-2x})=-2Ae^{-2x}$$The crucial step here is$$\frac{d}{dx}(Bxe^{-2x})=Bx\frac{d}{dx}(e^{-2x})+e^{-2x}\frac{d}{dx}(Bx)$$This simply resolves to$$\frac{d}{dx}(Bxe^{-2x})=-2Bxe^{-2x}+Be^{-2x}$$So when we put it all back together it gives
$$\frac{d}{dx}(y(x))=y'(x)=-2Ae^{-2x}-2Bxe^{-2x}+Be^{-2x}$$
Thus by factorising this you get the answer in the form given.
