I have three solutions: $$y_1(x)=xsin(x)+3cos(x)$$ $$y_2(x)=(x+5)sin(x)$$ $$y_2(x)=(x+4)sin(x)$$
of the diff.eq: $$y''+p(x)y'+q(x)y=g(x)$$
and the start condition: $$y(0)=y'(0)=0$$
I need to solve this Initial Value Problem. Now there are a lot of long ways to solve it, looking for a short one, but without any non-homogeneous formulas, because I've learned only homogeneous stuff.
I know that for homogeneous a general solution is a linear combination of the linear independent solutions, but I don't know if it is true for non-homogeneous (I think it's not, because there is non-zero on the right side of the eq.).
I probably could find $p,q$ and $g$, but that seems to be a long way and maybe unnecessary. How should I solve this eq, i.e find the needed coefficient without solving non-homogeneous, but transforming it to a homogeneous eq. problem ?
The common term of the three solutions is $y_p(x)=x\sin x$, leaving $\sin x$ and $\cos x$ as homogeneous basis solutions. This means for the differential operator on the left side $$ D^2+1=D^2+pD+q, $$ so that $p=0$, $q=1$, $r=2\cos x$.
So the solution satisfying the initial condition is the identified particular solution $$ y(x)=x\sin x. $$
This all is looking for the most simple pattern, not the most rigorous treatment of the situation. There may be other solutions with non-constant coefficients, there may be a solution where the right side is zero,...
More rigorous contemplations:
The difference $y_3-y_2=\sin x$ is a homogeneous solution, thus any $x\sin x+c\sin x$ is also a solution.
After identifying $x\sin x$ as one of the possible inhomogenous/particular solutions, from the first equation one concludes that also $\cos x$ is a homogeous/complementary solution. Note that $x\sin x$ satisfies the initial conditions. Now as homogeneous solutions both $$ 0=-\sin x+p\cos x+q\sin x\\ 0=-\cos x-p\sin x+q\cos x $$ which as linear system has the unique solution $p=0$, $q=1$, constant for all $x$. Both homogeneous basis solutions have one non-zero value in value and derivative, so that they can not contribute to the initial conditions.