Given a function $g$ which has derivative $g'$ for all x $\in {R}$ and satisfying $g'(0)=2$ and $g(x+y)=e^yg(x)+e^xg(y)$ for all $x,y\in {R}$
Show that $g'(x)+g(x)-2e^x=0$
$\dfrac{g(x+y)}{e^{x+y}}=\dfrac{g(x)}{e^{x}}+\dfrac{g(y)}{e^{y}}$
Putting $x=0$,
$g'(y)=2e^y+g(x)$
Also putting $y=0$,we get,
$0=e^xg(0)\implies g(0)=0$
I had a strong hunch that $g(x)=e^x-e^{-x}$ but it does not satisfy $g(x+y)=e^yg(x)+e^xg(y)$
Please help.
$$g(x+y) = e^y g(x) + e^x g(y)$$
Differentiating w.r.t. y
$$g'(x+y) = e^y g(x) + e^x g'(y)$$
Now put $y=0$
$$g'(x) = e^0 g(x) + e^x g'(0)\implies g'(x) - g(x) - 2e^x = 0$$