Is the linear combination of two solutions of a nonhomogeneous differential equation also a solution The question reads, if y1 and y2 are solutions of:
$y''+x^2y'-e^xy=1$
then is any linear combination of y1, y2 also a solution.
I know for a fact that the above statement is true for homogeneous equations; however does it still hold for the nonhomogeneous equation. Since y1 or y2 could be the particular solution rather than both being the part of the complementary solution I am unsure.
Thanks for your help.
 A: Converting my comment into an answer, with more details and precision.
Take your diff. eqn. replace $y$ by $y_1$, it is a valid eqn because $y_1$  is a solution. Call this eqn by the name, E1. Similarly you get E2, using the other solution $y_2$. Now substitute a linear combination, $ay_1+by_2$ into the original equation, and you will get (using E1, and E2) it simplifies to  $a+b$ and not 1, and hence the linear combination can be a solution if and only if  $a+b=1$. 
A: for y=c1y1 + c2y2 to be a solution c1+c2=1 must be satisfied.
here is a reader friendly proof:
This is true for a general linear 2nd order non-Homogenous ordinary differential equation with the following form:
y''+ P(x)y'+ Q(x)y = R(x).
Let us assign the operator operating on y’’, y’ and y with L:
L=y'' + P(x) y'+ Q(x)y
y1 and y2 are two solutions, which means that for each x the following is met:
L(y1)=y1''+ P(x)y1'+ Q(x)y1 = R(x)
L(y2)=y2''+ P(x)y2'+ Q(x)y2 = R(x)
Let L now operate on a linear combination of y1 and y2 (c1 and c2 are constants). Remember, L is a linear operator, and hence the following is true:
L(c1y1 + c2y2)= c1R(x)+ c2R(x)
In order for c1y1 + c2y2 to be a solution for the original ODE, L(c1y1 + c2y2) must be equal to R(x):
c1R(x) + c2R(x) = R(x)
R(x) is different than zero, otherwise that would render the last equation trivial. you can divide by R(x) and you get:
c1+c2=1
great, let us summarize: for the 2nd order equation y''+ P(x)y'+ Q(x)y = R(x), where y1 and y2 are two solutions, the linear combination cy1 + (1-c)y2 is also a solution.
actually, that will hold true not only for linear ODEs of second order but of any linear ODE of nth order since the left hand side can similarly be denoted by a linear L operator (this time operating on y, y'...y(n) ) and the right hand side is R(x) and hence, all steps mentioned above for proving are replicable. and a more general conclusion is that if you have more than two solutions, demand that the sum of the coefficients is equal to 1.
I hope this helped. it helped me understand more at least :)
