# Compact general solution to the DE of the form $u'' +u =0$

I want to pass from a solution of the form $u(\phi)=c_1 \sin (\phi) + c_2 \cos (\phi)$ to a one that look like this $u(\phi)=A \epsilon \cos (\phi-\phi_0)$

How i can get it analytically? And what is the value of the constant $A$, is it totally arbitrary? Thanks.

EDIT: Ok, i know that the boundary values determine a unique solution. But i.e binet's formula has the form $u'' +u = -k$ and the given answer answer (in the paper) is $u = -k + k \epsilon \cos (\phi - \phi _0 )$ where $\epsilon$ and $\phi _0$ are the boundary values. so $A$ is equaled to $k$ arbitrarily.

• In your final formula there is an extra parameter $\epsilon$, in that case your $A=k\epsilon$ with known $k$ but unknown $\epsilon$. Now $\epsilon$ may be determined by a suitable initial condition, as well as $\phi_0$. – HBR May 1 '17 at 18:05

Put $c_1=A\sin{\phi_0}$ and $c_2=A\cos{\phi_0}$ and apply the following formula: $$\sin{\phi}\sin{\phi_0}+\cos{\phi}\cos{\phi_0}=\cos{(\phi-\phi_0)}$$

The solution must depend on 2 constants, $c_1$ and $c_2$ or after our change $A$ and $\phi_0$. These constants are entirely arbitrary unless you specify two suitable initial conditions ($\textit{i.e.}$ velocity and position)

• Ok, i know that the boundary values determine a unique solution. – Gabriel Sandoval May 1 '17 at 17:50
• $A$ may be any number complex or not. But if you require $u$ to be a physical quantity it must be real and must be related to the initial velocity and position. – HBR May 1 '17 at 17:52

Using the addition formula gives $$R\cos{(\phi-\phi_0)} = (R\cos{\phi_0})\cos{\phi}+(R\sin{\phi_0})\sin{\phi}$$ Equating coefficients, $$c_1 = R\sin{\phi_0}, \qquad c_2 = R\cos{\phi_0}.$$ One can equally go the other way: $$R^2 = c_1^2 + c_2^2, \qquad \frac{c_1}{c_2} = \tan{\phi_0}.$$

$$u(\phi) = c_1 \sin (\phi) + c_2 \cos (\phi) = \\ = A\cos(\phi - \phi_0),$$

where

$$A = \sqrt{c_1^2 + c_2^2},$$

and

$$\phi_0 = \text{atan2}(c_1, c_2).$$

The function $\text{atan2}(\cdot)$ is defined here. If you are familiar with complex number, it corresponds with the phase of the complex number $c_2 + ic_1,$ which can't be calculated just using the standard $\text{atan}(\cdot)$.