Show that $f^2 − g^2 = C$ for some real constant C

Suppose $f$ and $g$ are continuously differentiable functions such that $f(x) = g'(x)$ and $g(x) = f'(x)$ and that any product of $f, f', g$ and $g'$ is commutative for all $x ∈ R$. Show that $f^2 − g^2 = C$ for some real constant C

I have actually no clue how to solve this, and would be really greatfull for all the help i can get

• Let $h=f^2 - g^2$ and compute $h'$.
– Mark
Apr 3, 2018 at 3:09
• So that $\delta/\delta f (f^2 - g^2) = 2f$ ? or is that wrong? Apr 3, 2018 at 3:22

Define a new function $\gamma(x) = f^2(x) - g^2(x)$, then the derivative is: $$\frac{\mathrm{d}\gamma}{\mathrm{d}x} = 2 f(x) \frac{\mathrm{d}f}{\mathrm{d}x} - 2 g(x) \frac{\mathrm{d}g}{\mathrm{d}x} = 2 \Big(\underbrace{\frac{\mathrm{d}g}{\mathrm{d}x}}_{=f(x)}\frac{\mathrm{d}f}{\mathrm{d}x} - \underbrace{\frac{\mathrm{d}f}{\mathrm{d}x}}_{=g(x)} \frac{\mathrm{d}g}{\mathrm{d}x} \Big)$$ And since these commute, so that: $$\frac{\mathrm{d}g}{\mathrm{d}x}\frac{\mathrm{d}f}{\mathrm{d}x} = \frac{\mathrm{d}f}{\mathrm{d}x} \frac{\mathrm{d}g}{\mathrm{d}x}$$ The term in the brackets is zero, thus: $$\frac{\mathrm{d}\gamma}{\mathrm{d}x} =0$$ Which implies that $\gamma(x) = f^2(x) - g^2(x)$ is a constant, say, $C$. $$f^2(x) - g^2(x) = C$$
From the assumptions we conclude that $$f''=g'=f$$ and thus \begin{aligned}f&=c_1e^x+c_2e^{-x},\\ g&=f'=c_1e^x-c_2e^{-x}. \end{aligned} As a result, \begin{aligned}f^2-g^2&=(f+g)(f-g)\\ &=(2c_1e^x)(2c_2e^{-x})\\ &=4c_1c_2\\ &=C. \end{aligned}