Question

This question concerns the differential equation `x(d^2y)/(dx^2)-(2x+1)(dy)/(dx)+(x+1)y=4xe^x`, and the associated homogeneous differential equation `x(d^2y)/(dx^2)-(2x+1)(dy)/(dx)+(x+1)y=0`.

  1. Show that `y_1(x)=e^x` is a solution of the homogeneous differential equation.
  2. Use the method of reduction of order to show that a second linearly independent solution of the homogeneous differential equation is `y_2(x)=x^2e^x`.
  3. Use the method of variation of parameters to find the general solution of the given nonhomogeneous differential equation [Hint: Write the differential equation in standard form!].

Answer

`x(d^2y)/(dx^2)-(2x+1)(dy)/(dx)+(x+1)y=4xe^x`.

  1. Write down homogeneous equation:

    `x(d^2y)/(dx^2)-(2x+1)(dy)/(dx)+(x+1)y=0`.

    `y_1(x)=e^x` is solution of the given homogeneous equation because

    `x(d^2(y_1(x)))/(dx^2)-(2x+1)(d(y_1(x)))/(dx)+(x+1)y_1(x)=`

    `=x(d^2(e^x))/(dx^2)-(2x+1)(d(e^x))/(dx)+(x+1)e^x=`

    `=xe^x-(2x+1)e^x+(x+1)e^x=e^x(x-2x-1+x+1)=e^x*0=0`.

  2. Now, assume that second solution is `y_2(x)=v(x)y_1(x)=v(x)e^x`.

    Then `(dy_2)/(dx)=(dv)/(dx)e^x+ve^x` and

    `(d^2y_2)/(dx^2)=(d^2v)/(dx^2)e^x+(dv)/(dx)e^x+(dv)/(dx)e^x+ve^x=(d^2v)/(dx^2)e^x+2(dv)/(dx)e^x+ve^x`.

    Plugging these results into the given homogeneous differential equation gives:

    `x((d^2v)/(dx^2)e^x+2(dv)/(dx)e^x+ve^x)-(2x+1)((dv)/(dx)e^x+ve^x)+(x+1)ve^x=0`

    Or

    `x((d^2v)/(dx^2)e^x-(dv)/(dx)e^x)=0`.

    Divide left and right parts by `xe^x`:

    `(d^2v)/(dx^2)-1/x(dv)/(dx)=0`.

    Now, let `w=(dv)/(dx)` then `(dw)/(dx)=(d^2v)/(dx^2)` and equation can be rewritten as

    `(dw)/(dx)-1/xw=0`.

    This is first-order separable differential equation:

    `(dw)/w=(dx)/x`.

    `int(dw)/w=int(dx)/x`.

    `ln(w)=ln(x)+c`, where `c` is arbitrary constant.

    Now,

    `e^(ln(w))=e^(ln(x)+c)`.

    `w=e^cx=c_1x`, where `c_1` is arbitrary constant.

    Since `w=(dv)/(dx)` then `(dv)/(dx)=c_1x`.

    `v=intc_1xdx=c_1/2x^2+c_2`.

    Since we need any particular solution for `v` then take `c_1=2`, `c_2=0`.

    Thus, `v=x^2`.

    Finally, `y_2(x)=ve^x=x^2e^x`.

    Clearly `y_1(x)` and `y_2(x)` are linearly independent.

    So, general solution of the given homogeneous differential equation is

    `y_h=a_1e^x+a_2x^2e^x`, where `a_1` and `a_2` are arbitrary constants.

  3. Rewrite the given inhomogeneous equation in standard form. For this divide left and right part by `x`:

    `(d^2y)/(dx^2)-((2x+1))/x(dy)/(dx)+((x+1))/xy=4e^x`.

    Now assume that constants in the homogeneous solution are functions of `x`. Set up following system:

    `{((da_1)/(dx)e^x+(da_2)/(dx)x^2e^x=0), ((da_1)/(dx)(d(e^x))/(dx)+(da_2)/(dx)(d(x^2e^x))/(dx)=4e^x):}`.

    Or

    `{((da_1)/(dx)e^x+(da_2)/(dx)x^2e^x=0),((da_1)/(dx)e^x+(da_2)/(dx)(2xe^x+x^2e^x)=4e^x):}`.

    Subtract first equation from second:

    `(da_1)/(dx)e^x+(da_2)/(dx)(2xe^x+x^2e^x)-((da_1)/(dx)e^x+(da_2)/(dx)x^2e^x)=4e^x-0`

    Which yields

    `2xe^x(da_2)/(dx)=4e^x`

    Or

    `(da_2)/(dx)=2/x`.

    `a_2=int2/xdx=2ln(x)`.

    (We've taken integration constant 0, since we need particular solution).

    Now, from first equation of the system

    `(da_1)/(dx)=-(da_2)/(dx)x^2=-2/x*x^2=-2x`.

    `a_1=int-2xdx=-x^2`.

    (We've taken integration constant 0, since we need particular solution).

    Therefore,

    `y_p=a_1(x)e^x+a_2(x)x^2e^x=-x^2e^x+2ln(x)x^2e^x`.

    Finally general solution of the given inhomogeneous system is

    `y=y_h+y_p=a_1e^x+a_2x^2e^x-x^2e^x+2ln(x)x^2e^x`

    Or

    `y=a_1e^x+a_2x^2e^x+x^2e^x(2ln(x)-1)`.