# Method of Reduction of Order and Variation of Parameters

#### Sudharaka

##### Well-known member
MHB Math Helper
Hi everyone,

One of my friends gave me the following question. I am posting the question and the answer here so that he could check his work.

Question:

This question concerns the differential equation,

$x\frac{d^{2}y}{dx^2}-(x+1)\frac{dy}{dx}+y=x^2$

and the associated homogeneous differential equation,Wronskian - Wikipedia, the free encyclopedia

$x\frac{d^{2}y}{dx^2}-(x+1)\frac{dy}{dx}+y=0$

a) Show that $$y_{1}(x)=e^x$$ is a solution of the homogeneous differential equation.

b) 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+1$$.

Hint:
$$\int xe^{-x}\,dx=-(x+1)e^{-x}+C$$

c) Use the method of variation of parameters to find the general solution of the given non-homogeneous differential equation.

Hint:
Write the differential equation in standard form and remember the hint from part (b).

#### Sudharaka

##### Well-known member
MHB Math Helper
For part a),

Substitute $$y=e^x$$ in the right hand side of,

$x\frac{d^{2}y}{dx^2}-(x+1)\frac{dy}{dx}+y=0$

and show that it satisfies the above equation.

For part b),

Let $$y_{2}(x)=v(x)e^x$$ be the second linearly independent solution. Substituting this in the homogeneous equation we get,

$x\frac{d^{2}}{dx^2}[v(x)e^x]-(x+1)\frac{d}{dx}[v(x)e^x]+v(x)e^x=0$

Simplification yields,

$\Rightarrow xe^xv''(x)+(2xe^x-(x+1)e^x)v'(x)+(xe^x-(x+1)e^x+e^x)v(x)=0$

$\Rightarrow xe^xv''(x)+(xe^x-e^x)v'(x)=0$

$\Rightarrow xv''(x)+(x-1)v'(x)=0$

Using separation of variables,

$v(x)=A(x+1)e^{-x}+B$

where $$A$$ and $$B$$ are arbitrary constants. Therefore,

$y_{2}(x)=A(x+1)+Be^x$

Since the second term, $$Be^x$$ and $$y_{1}(x)$$ are linearly dependent we can neglect that term to get, $$y_{2}(x)=x+1$$ as the second solution to the homogeneous differential equation. The two solutions $$y_{1}(x)=e^x$$ and $$y_{2}(x)=x+1$$ are linearly interdependent which could be verified from the Wronskian.

$W(y_1,\,y_2)(x)=\begin{vmatrix} e^x & x+1 \\ e^x & 1 \end{vmatrix}=-xe^x\neq 0$

Therefore the general solution of the homogeneous part is,

$y_{c}(x)=A(x+1)+Be^x$

For part c),

I am sure you must have learnt about the variation of parameters method and I am not going to go through the details. A step by step analysis of the variation of parameters method can be found >>here<<. Our differential equation is,

$x\frac{d^{2}y}{dx^2}-(x+1)\frac{dy}{dx}+y=x^2$

$\Rightarrow \frac{d^{2}y}{dx^2}-\left(\frac{x+1}{x}\right)\frac{dy}{dx}+\left( \frac{1}{x}\right)y=x$

Let, $$q(x)=-\frac{x+1}{x},\, r(x)=\frac{1}{x}$$ and $$g(x)=x$$. Now the particular solution to the non-homogeneous differential equation is,

$y_{p}(x)=-y_1(x)\int\frac{y_2(x)g(x)}{W(y_1,\,y_2)(x)}\,dx+y_{2}(x)\int\frac{y_1(x)g(x)}{W(y_1,\,y_2)(x)}\,dx$

Substitute and simplify to get,

$y_{p}(x)=-(x^2+2x+2)$

Therefore the general solution of,

$x\frac{d^{2}y}{dx^2}-(x+1)\frac{dy}{dx}+y=x^2$

is,

$y(x)=y_{p}(x)+y_{c}(x)=-(x^2+2x+2)+A(x+1)+Be^x$

where $$A$$ and $$B$$ are arbitrary constants.

#### Jester

##### Well-known member
MHB Math Helper
I have a comment that can really put parts (b) and (c) together. Use reduction of order on the whol DE. Using

$y = u e^x$ gives

$xu'' +(x-1)u' = x^2 e^{-x}\;\;\;(1)$

Letting $v = u'$ make (1) a first order linear DE - easy to integrate. Then $v = u'$ gives a separable equation to integrate. I still don't know why this technique is not as well publicized as should be.