Find differentiable functions satisfying conditions Find all $ f,g: \mathbb{R} \rightarrow \mathbb{R} $ that satisfy the following conditions:


*

*$ f, g $ are differentiable

*$ f', g' $ are continuous

*$ f^{2} + g^{2} = f'^{2} + g'^{2} $

*$ f + g = g' - f'$

*the equation $ f(x) = g(x) $ has 2 real solutions, the lowest of which is $ 0 $
I tried a couple of things:
From the 4th condition, by squaring and using the third condition, we get that $$ f'g' = -fg$$
Dividing the above by $ fg $ we get that $$ \frac{f'}{f} \cdot \frac{g'}{g} = -1 $$
which can be rewritten as $$ (\ln{f})' \cdot (\ln{g})' = -1 $$
I didn't know how to use this last information so I went on to see what I can get from the last condition. So in this regard, I considered the function $ h = f - g $. The last condition tells us that $$ h(0) = h(a) = 0 $$ for some real number $ a > 0 $. Then from Lagrange's theorem or even simpler, from Rolle's theorem we get that there exists $ c \in (0,a) $ such that $ h'(c) = 0 $. Therefore $ g'(c) = f'(c) $ and using the 4th condition we get that $$ f(c) + g(c) = 0 $$
so $ g(c) = -f(c) $. But then, if we couple this with the 3rd condition we have: $$ 2f^{2}(c) = 2f'^{2}(c) $$ hence $ f'(c) = f(c) $ or $ f'(c) = -f(c) $. 
I get stuck at this point and don't really know how to approach the problem anymore. I would appreciate any help or suggestions. Thank you very much in advance.
 A: $f^{2}-g'^{2}=f'^{2}-g^{2}$ is equivalent to:
$$(f-g')(f+g')=(f'-g)(f'+g)$$
Case 1:
Now using $f-g'=-(f'+g)$ and dividing (assuming both expressions are non-zero)
$$f+g'=-(f'-g)$$
Or $f+f'=g-g'$. We combine this with $f+g=g'-f'$ because adding and subtracting respectively gives:
$$2f=-2f'$$
$$2g=2g'$$
So $f(x)=c_1e^{-x}$ and $g(x)=c_2e^{x}$.
Since $f(0)=g(0)$, it follows $c_1=c_2=c$.
We can check that so far all your conditions are satisfied, except that $f=g$ has two solutions. If $a>0$ is another solution then
$ce^{-a}=ce^{a}$ implies $c=0$, so $f=g=0$ everywhere.
Case 2:
Finally, what about my division earlier? What if I divided by zero? Then we would have $f-g'=f'+g=0$? Certainly if this is true for all $x$, then if $f=g'$ and $f$ is differentiable, $g'$ is too and $f'=g''$.
Then we get $f'+g=0$ implies $g''+g=0$. Then $g=c_1cos(x)+c_2sin(x)$. Likewise if $g=-f'$ then $g'=-f''$ and $f+f''=0$ so $f=c_3cos(x)+c_4sin(x)$.
I am much too lazy with coefficients and will take a more abstract approach to showing $f=g$ everywhere. Indeed suppose $f=g$ at $n$ points, the smallest of which are $0$ and $a_n>0$. Then by Rolle's theorem there is $a_{n+1} \in (0,a_n)$ such that $f'(a_{n+1})=g'(a_{n+1})$. But you have already correctly shown that:
$$f'g'=-fg$$
It follows $f(a_{n+1})g(a_{n+1})=0$
Either $f$ or $g$ is zero at $a_{n+1}$. Assume $f$ is. Then $f^{2}+g^{2}=f'^{2}+g'^{2}$ at $a_{n+1}$ shows $g$ is $0$ as well at $a_{n+1}$. Same for $g$ assumed first.
So $f=g(=0)$ at an infinite number of points on $(0,a)$. We have already shown $f$ and $g$ are trigonometric with $4$ free parameters total. Clearly this implies
$$f=g=c_1cos(x)+c_2sin(x)$$
$f+g=f'-g'$ then again gives $f=g=0$.
