Particular Solution

Consider the nonhomogeneous differential equation `y^((n))+a_(n-1)(x)y^((n-1))+...+a_1(x)y'+a_0(x)y=g(x)`.

Recall from the section about linear independence that the solution of the corresponding homogeneous equation `y^((n))+a_(n-1)(x)y^((n-1))+...+a_1(x)y'+a_0(x)y=0` is given as `y_h=c_1y_1(x)+c_2y_2(x)+...+c_ny_n(x)`.

Then, if `y_p` is the solution of the nonhomogeneous equation, the general solution of the nonhomogeneous equation is `y=y_h+y_p`.

Proof.

Plug in `y=y_h+y_p` into the differential equation:

`(y_h+y_p)^((n))+a_(n-1)(x)(y_h+y_p)^((n-1))+...+a_1(x)(y_h+y_p)'+a_0(x)y=`

`=(y_h^((n))+a_(n-1)(x)y_h^((n-1))+...+a_1(x)y_h'+a_0(x)y_h)+(y_p^((n))+a_(n-1)(x)y_p^((n-1))+...+a_1(x)y_p'+a_0(x)y_p)=`

`=0+g(x)=g(x)`

So, indeed, `y=y_p+y_h` is the solution of the nonhomogeneous differential equation.

Now, let's consider an example.

Example. The solution of the homogeneous equation `y''+y'-2y=0` is `y_h=c_1e^(-2x)+c_2e^(x)`.

For the nonhomogeneous equation `y''+y'-2y=2(1+x-x^2)`, the particular solution is `y_p=x^2`.

So, the general solution of the nonhomogeneous differential equation is `y''+y'-2y=2(1+x-x^2)` is `y=y_h+y_p=c_1e^(-2x)+c_2e^x+x^2`.