I've been given three solutions of a non-homogeneous differential equation: $$y_1(x)=1+e^{x^2},\;y_2(x)=1+xe^{x^2},\;y_3(x)=(1+x)e^{x^2}-1$$
I'm supposed to find the general solution of that differential equation. $[y''+p(x)y'+q(x)=r(x)]$
Now, $y_4=y_3-y_1$ and $y_5=y_3-y_2$ would give me solutions of the corresponding homogeneous differential equation. $[y''+p(x)y'+q(x)=0]$
So, I write the general solution of the homogeneous equation as $y=c_1y_4+c_2y_5$, and then proceed to differentiate the solution twice to remove $c_1$ and $c_2$. I hope to get the homogeneous equation from there, and then substituting one of the above three given solutions, I can find $r(x)$, and then using 'Variation of Parameters', can find the general solution of the non-homogeneous equation.
Problem is, I get a very ugly equation when I differentiate that general solution twice, in terms of $y_4$, $y_5$ and their derivatives. Substituting actual functions of $y_4$ and $y_5$ only makes it uglier. Cuz I don't see any cancellations happening.
Is there a simpler method?
EDIT: Please tell me if this approach is correct. The solution of homogeneous equation is $y=c_1y_4+c_2y_5$. I can write the solution of non-homogeneous equation as $y=c_1y_4+c_2y_5+y_p$, where $y_p$ is a particular solution of the non-homogeneous equation. The given three solutions act as particular solutions and I can just substitute one of them for $y_p$ and get my general solution.