Example 4: Solve
.
Solution: The roots of the characteristic equation are
> solve(r*(r-1)+2*r-12=0);
Hence two independent solutions of the homogeneous equation are
and
. We find a particular solution using the method of variation. Recall that for this method to work the differential equation has to be in the standard form
. Thus new
for Euler equation is equal to
.
> y[1]:=x->x^(-4);y[2]:=x->x^3;
> solve({y[1](x)*dc[1]+y[2](x)*dc[2]=0,diff(y[1](x),x)*dc[1]+diff(y[2](x),x)*dc[2]=sqrt(x)/x^2},{dc[1],dc[2]});
> c[1]:=int(-1/7*x^(7/2),x);c[2]:=int(1/7/x^(7/2),x);
So the particular solution is
> c[1]*y[1](x)+c[2]*y[2](x);
Hence the general solution to the nonhomogeneous equation is
.