Analytic solutions to $f(x+y) +h(x+y)= f(x)(g(y)+h(y)) + g(x)(f(y)+h(y)) + h(x)(f(y)+g(y))$? Let $x,y$ be complex numbers. Consider $f(x+y) +h(x+y)= f(x)(g(y)+h(y)) + g(x)(f(y)+h(y)) + h(x)(f(y)+g(y))$ valid for all $x,y$.
What are the analytic solutions for $f,g,h$ ?
Can we conclude an addition formula for $g(x+y)$ ?
 A: I will restrict myself to the case of functions on $\mathbb{R}$, but I think this will mostly generalize to the complex case as well. I can give a rather restrictive necessary condition on potential solutions and a number of specific solutions. I can also give a method in theory for finding all of the solutions, though it would be tedious in practice.
Defining functions $p(x)=f(x)+h(x)$ and $q(x)=g(x)+h(x)$, we get the equivalent functional equation:
$$p(x+y)=p(x)q(y)+p(y)q(x)-2h(x)h(y)$$
If we find solutions to this, we can recover $f(x)=p(x)-h(x)$ and $g(x)=q(x)-h(x)$. Now, this equation says that the translates $p_y$ of $p$ (where $p_y(x)=p(x+y)$) are contained in $\text{span}\{p, q, h\}$. Let $S = \{ap_b : a,b \in \mathbb{R}\}$, let $V$ be the vector space generated by $S$, and let $n = \dim V$. We see that $n \leq 3$, so we consider each case:


*

*If $n = 0$, then $p=0$, so this case corresponds to solutions of the form $p(x)=h(x)=0$ and $q$ any analytic function on $\mathbb{R}$.

*If $n=1$, then the $q=a p$ and $h=b p$ for some $a,b \in \mathbb{R}$, so the equation becomes $p(x+y)=2(a-b^2)p(x)p(y)=p(x)p(y)$. The only continuous solutions of this are $p(x)=2(a-b^2)e^{rx}$. Therefore the case $n=1$ corresponds to solutions of the form $p(x)=2(a-b^2)e^{rx}$, $q(x)=ae^{rx}$, $h(x)=be^{rx}$. Note that this satisfies the ODE $f'-rf=0$.

*If $n=2$, then as described in the answers to this question $p$ must be a solution to the ODE $f''+Bf'+Cf=0$ other than $ce^{rx}$.

*If $n=3$, then by the logic used in the answers to this question modified for the case $\dim V = 3$, $p$ must be a solution to the ODE $p'''+Bp''+Cf'+Dp=0$ other than one of the solutions discussed above. (The proof is modified by replacing $M(x_1,x_2)$ with $M(x_1,x_2,x_3)$ and finding points at which it is nonsingular, which must exist since $\dim V = 3$, and noting that $\{p,p',p''\}$ must be linearly independent since otherwise $p$ would either be an exponential or it would satisfy the second degree ODE above for the case $n=2$.)
In particular, we see that every analytic solution $p(x)$ to the original functional equation will be a solution to an ODE of the form $Ap'''+Bp''+Cp'+Dp=0$ for constants $A,B,C,D \in \mathbb{R}$, some of which may be zero. Since this is a linear, translation invariant ODE, it follows that all elements of $V$ will satisfy it.
Suppose we have some solution other than the trivial case where $p$ is identically zero. Since for given $y$ we have $p_y-q(y)p=p(y)q-2h(y)h$ (where $p_y$ is the translate $p_y(x)=p(x+y)$), it follows that $p(y)q-2h(y)h \in V$ for all $y \in \mathbb{R}$. If $p$ and $h$ are linearly independent then this implies that $q \in V$ and $h \in V$. If $p$ and $h$ are linearly dependent, then $h$ is a multiple of $f$, so $h \in V$, and then $q$ is a linear combination of $h \in S$ and $p(y)q-2h(y)h$ and thus $q \in V$. Therefore in either case we have $q \in V$ and $h \in V$, so $q$ and $h$ also satisfy the ODE, i.e. $Aq'''+Bq''+Cq'+Dq=0$ and $Ah'''+Bh''+Ch'+Dh=0$.
In summary, there exists a homogeneous ODE of the form $A\phi'''+B\phi''+C\phi'+D\phi=0$ with $p$, $q$, and $h$ as solutions (ignoring the trivial case $p=0$, where $q$ may be any analytic function). This has a finite number of families of solutions, and they may be found explicitly via the usual methods of solving linear ODEs. In theory this could be used to find all of the solutions to our functional equation by plugging these back in to our original functional equation and seeing if it is satisfied. This would clearly be quite labor-intensive and I won't bother doing so here (perhaps it could be done via computer). However, there are a number of particular solution families that we can readily derive by hand:


*

*$p(x)=h(x)=0$, $q$ any analytic function on $\mathbb{R}$

*$p(x)=2(a-b^2)e^{rx}$, $q(x)=ae^{rx}$, $h(x)=be^{rx}$ (as derived above)

*In the case $h=0$, we can describe the solutions exactly as described in this answer; the solutions are then one of the following:


*

*$p(x)=ke^{rx}$, $q(x)=\frac{1}{2}e^{rx}$, $h(x)=0$

*$p(x) = kxe^{rx}$, $q(x)=e^{rx}$, $h(x)=0$

*$p(x) = ke^{rx}\sin(sx)$, $q(x)=e^{rx}\cos(sx)$, $h(x)=0$

*$p(x)= ke^{rx}\sinh(sx)$, $q(x)=e^{rx}\cosh(sx)$, $h(x)=0$


*Since $p(x)q(y)+p(y)q(x)=p(x)(q(y)+a^2 p(x))+p(y)(q(x)+a^2 p(x))-2a^2p(x)p(y)$ for any $a \in \mathbb{R}$, we can replace $(q,h)$ by $(q+a^2f, af)$ in the above four solution families that have $h=0$ to get the following solutions:


*

*$p(x)=ke^{rx}$, $q(x)=(\frac{1}{2}+ka^2)e^{rx}$, $h(x)=kae^{rx}$

*$p(x) = kxe^{rx}$, $q(x)=(ka^2x+1)e^{rx}$, $h(x)=kaxe^{rx}$

*$p(x) = ke^{rx}\sin(sx)$, $q(x)=e^{rx}(ka^2\sin(sx)+\cos(sx))$, $h(x)=kae^{rx}\sin(sx)$

*$p(x)= ke^{rx}\sinh(sx)$, $q(x)=e^{rx}(ka^2\sinh(sx)+\cosh(sx))$, $h(x)=kae^{rx}\sinh(sx)$
