Number of arbitrary constants in an ODE Consider the general solution of a differential equation-
$$y=(C_1+C_2)\cos(x+C_3)+C_4\exp(x)+C_5$$
Without differentiating this equation and finding the differential equation for it, how can we say what the order of that DE is. Ofcourse, we can always count the number of arbitrary constants, which in this case I think are $4$ (since $C_1+ C_2$ is just one). But my textbook says that the DE has order $3$. Am I missing something? I think my mistake is in not absorbing one more constant, which I tried doing in the following way-
$$y=K (\cos C_3 \cos x-\sin C_3 \sin x)+C_4\exp(x)+C_5$$
and then we can also absorb the cosine and sine of $C_3$. But even here, it appears to me that we still have $4$ constants.
Any help is appreciated.
 A: As $C_1+C_2=C_0$, so there are effectively 4 parameters in the solution so its ODE must be of oder $4$.
Let us set up the ODE for
$$y=C_0 \cos(x+C_3)+C_4 e^x+C_5~~~~(1)$$
D. w. r. $x$, then
$$y'=-C_0 \sin(x+C_3)+C_4 e^x \implies e^{-x}y'=-C_0 e^{-x}\sin(x+C_3)+C_4~~~(2)$$
D. w.r. t. $x$
$$-e^{-x}y'+e^{-x}y''=C_0 e^{-x} \sin(x+C_3)-C_0 e^{-x} \cos (x+C_3)$$
$$\implies y''-y'=C_0 \sin(x+C_3)-C_0 \cos(x+C_3)~~~~(3).$$
D. W.R. t. $X$
$$\implies y'''-y''=C_0 \cos(x+C_3)+C_0 \sin (x+C_3)~~~(4)$$
Adding  (3) and (4), we get
$$y'''-y'=2C_0 \sin (x+C_3)~~~~(5)$$
Subtracting (3) and (4) we get
$$y''-y'-y'''+y''=-2C_0 \cos(x+C_3)~~~~(6)$$
D. w. r. t. $x$ in (5), we get
$$y''''-y''=2C_0 \cos (x+C_3)~~~~(7)$$
Adding (6)and  (7) , we successfully get the req\uired fouth degree ODE as:
$$y''''-y'''+y''-y'=0,$$
where all the parameters are eliminated.
A: You can indeed rewrite the solution as
$$y=a\cos x+b\sin x+ce^x+d$$ where the four constants are independent. As the functions $\cos x,\sin x,e^x$ and $1$ are linearly independent, the expression does have four DOFs.

The terms will be respectively eliminated by the operators $D^2+1,D-1$, and $D$,
giving the equation
$$(D^2+1)(D-1)Dy=0$$
or
$$y''''-y'''+y''-y'=0$$ like said in the comments.
