# Differential dilemma

The question is as stated below -

If $f(x)$ and $g(x)$ are two functions such that $f'(x) = g(x)$ and $g'(x) = -f(x)$, and $f(2) = f'(2) = 4$, find $f^2 (24) + g^2 (24)$.

My initial approach : I tried solving the DE after using the first two given conditions : $f''(x) = -f(x)$, guessing a solution $A \sin x + B \cos x$, and then trying to find a relation between the constants $A$ and $B$.I'm stuck in a mess. Is there a better way to solve this? I'm sure there is.

This is not homework.

• You don't need to solve it, though you should recognize it from the trig functions. Let $h(x)=f^2(x)+g^2(x)$ and compute $h'(x)$.
– lulu
Aug 7, 2017 at 16:47
• I haven't worked the problem but here's where I'd start: the fact that $\sin^2 + \cos^2 = 1$ is suggestive. Try computing what you want in terms of $A$ and $B$ before finding $A$ and $B$. Then maybe double or triple angle formulas? Edit: @lulu 's hint is probably better. Aug 7, 2017 at 16:49
• @lulu : Excellent hint. I hit upon the answer the same way levap did it in the answer section! Aug 7, 2017 at 16:55

Let's set $h(x) = f^2(x) + g^2(x)$. Then
$$h'(x) = 2 f(x) f'(x) + 2 g(x) g'(x) = 2f(x) g(x) - 2 g(x) f(x) \equiv 0$$
so $h$ is constant. Since $h(2) = f^2(2) + g^2(2) = 4^2 + (f'(2))^2 = 4^2 + 4^2 = 32$, we get $h(24) = 32$.
You found that $$f (x)=A\sin (x)+B\cos (x)$$ then $$g (x)=f'(x)=A\cos (x)-B\sin (x)$$
thus $$f^2 (x)+g^2 (x)=A^2+B^2$$ $$=constante=f^2 (2)+f'^2 (2)$$ $$=4^2+4^2=32$$ $$=f^2 (24)+g^2 (24) .$$