# Prove the sum of squares of two functions equals 1

If you have $f'(x)=g(x)$, $g'(x) = -f(x)$, $f(0)=0$ and $g(0)=1$, how do you prove that $f^2(x)+g^2(x) = 1$?

• Notice that your title says “square of the sum”, while you meant “sum of the squares”. When students of mine this mistake, I belabored them severely for the sin. – Lubin Aug 6 '13 at 20:08

Differentiate $f^2 + g^2$:

$$(f^2 + g^2)' = 2f f' + 2g g' = 2f g + 2g (-f) = 0$$

Hence, $f^2 + g^2$ is a constant. Now evaluate at a point.

• The last $f'$ should be an $f$, yes? – hasnohat Aug 6 '13 at 19:16
• @Julien Yes, thank you. – user61527 Aug 6 '13 at 19:18

T. Bonger's answer is a good natural one, but you could also use Picard's existence theorem to conclude that $f(x)=\sin(x)$ and $g(x)=\cos(x)$.

• Note you can use \sin instead of sin (and cos) to have them rendered properly – Tobias Kienzler Aug 7 '13 at 7:59
• @TobiasKienzler: Yes, I knew but I was a bit lazy to do so. I edited my post anyway. – user66733 Aug 7 '13 at 14:36
• No worries, I just couldn't edit it in myself (<2k rep means a suggested edit must be longer to be considered "significant" - silly system) – Tobias Kienzler Aug 7 '13 at 15:19

An alternative way to show the identity you seek as well as show that $f(x)=\sin(x)$ and $g(x)=\cos(x)$ is the following.

Suppose $f''+f=0$, $f(0)=0$ and $f'(0)=0$ then $f=0$ since multiplying $f''+f=0$ by $f'$ gives

$0=f'f''+ff'=\frac{1}{2}((f')^{2}+f^{2})'$ then we conclude that $(f')^{2}+f^{2}$ is constant. With the initial conditions we find that the constant is $0$. This implies the differential equation $f''+f=0$ with initial conditions $f(0)=0$ and $f'(0)=1$ has one solution since if $f,g$ are solutions then $(f-g)''+(f-g)=0$, $(f-g)(0)=0$, $(f-g)'(0)=0$.

You said $f'(x)=g(x)$ and $g'(x)=-f(x)$ so $f''(x)=g'(x)=-f(x)$. So $f''(x)+f(x)=0$. Also $f(0)=0$ and $f'(0)=g(0)=1$. Note $f(x)=\sin(x)$ solves the differential equation and hence $g(x)=\cos(x)$ So $f^{2}(x)+g^{2}(x)=1$.