Why are we allowed to impose a constraint when using the method of variation of parameters to solve second order, linear ODEs We never actually covered the method of variation of parameters in class as it was marked as optional so the lecturer said it's our choice whether we cover it or not. I wanted to cover it and have no problems using this method for first order ODEs but upon reading the example in the notes that shows using variation of parameters to solve second order ODEs I see something that I don't understand. The example provided is:
Find the general solution of $$y''+y'-2y=e^x$$
Finding the homogeneous solution is self explanatory giving:
$$y=C_1(x)y_1(x)+C_2(x)y_2(x)=C_1e^{-2x} + C_2e^{x}$$
$$y'=C^{'}_1e^{-2x}-2C_1e^{-2x}+C^{'}_2e^x+C_2e^x$$
Then the example says "...we impose on $C_1(x)$ and $C_2(x)$ a constraint:"
$$C^{'}_1e^{-2x} + C^{'}_2e^{x}=0$$
I cannot for the life of me understand why we are allowed to do this and where it comes from. I asked my lecturer and he said:

With two unknown constants, we can impose two constraints on them to find a unique solution. One constraint follows from the ODE itself, leaving us the freedom to select the other constraint a convenient. And the choice of Lagrange is convenient indeed!

I replied:

Forgive me if it is obvious but I am still unsure as to why we know that the constraint is equal to zero – I assume it somehow follows from the ODE like you said but I cannot see how.

Then finally he said:

We do not KNOW that — we DECIDE to impose such a constraint because it helps to solve the problem. The other constraint follows from the equation — no independent decisions there.

Unfortunately this does not make anything clearer so if anyone could help explain it to me I would be very grateful!
 A: Both $y(x)=C_1(x)e^{-2x}$ and $y(x)=C_2(x)e^x$ provide a parametrization of the full function space, as the exponentials are never zero. The combination $y(x)=C_1(x)e^{-2x}+C_2(x)e^x$ is thus over-parametrized, one could say that there is one degree of freedom between the coefficient function. That can be fixed by any functional equation between them, here it is chosen to prevent second derivatives of the coefficients when inserting the parametrization into the differential equation.
A similar situation exists when solving cubic equations $0=x^3+px+q$. There one sets $x=u+v$ to get after insertion $0=u^3+v^3+(u+v)(3uv+p)+q$. Selecting the algebraic dependence as $3uv+p=0$ simplifies the remaining equation and leads to the Cardano formulas.
A: Your formula $y(x) = C_1(x)y_1(x) + C_2(x)y_2(x)$ is what we call an ansatz - a clever guess at the form of a solution. When you are assured to have unique solutions (eg. Picards Theorem), then if you manage to find/guess any solution that must be the unique solution and you've completely solved the problem. The general strategy is to substitute the ansatz into the equation and try to solve for any unknowns. Usually, there isn't enough information so  you add any constraints that you think might be helpful until you find a solution.
This is really strange, but the logic is: if you guess the solution, then you've found all the solutions. So you are allowed to impose any constraints you like, as long as it works. If you impose a different constraint, then either you'll end up with a contradiction or it will work and you'll have the same answer.
This is technically why we're allowed to impose this condition, but it doesn't explain why this is a good condition to impose. That's a separate question, but I think these notes do a good job at answering it.
