Example 1: Find a particular solution of
.
Solution: Since
is a polynomial of degree 2, then we are looking for a particular solution that is a linear combination of
and
. This linear combination is of the form
.
> diff(a*x^2+b*x+c,x,x)+a*x^2+b*x+c-x^2;
> p:=unapply(%,x);
> solve({p(0)=0,p(1)=0,p(2)=0},{a,b,c});
Therefore a particular solution is
.
If
, then we are looking for a particular solution that is a linear combination of
and
. This linear combination is of the form