# Homework2 R2.10

## Problem R*2.10: Solve the non-homogeneous L1-ODE-VC

 We solved it on our own

### Statement

The non-homogeneous L1-ODE-VC is

$y'+\frac{1}{x}y=x^2$

Show that

$h(x)=x$ and $y(x)=\frac{x^3}{4}+\frac{k}{x}$

### Solution

We first check the exactness condition 1:

the original equation can be written as:

 $(\frac{1}{x}y-x^2)+y'=0,$ (2.10.1)

which is in the form:

 $M(x,y)+N(x,y)y'=0$ (2.10.2)

Here $M(x,y)=\frac{1}{x}y-x^2$ and $N(x,y)=1$. So the first exactness condition holds.

For exactness condition 2:

 $M_y=\frac{\partial M}{\partial y}=\frac{1}{x}$ (2.10.3)
 $N_x=\frac{\partial N}{\partial x}=0$

Then $M_y \neq N_x$. So the second exactness condition does not hold.

Assume a factor $h(x,y)$. Let

 $\overline{M}(x,y)=h(x,y)M(x,y)$ (2.10.4)
 $\overline{N}(x,y)=h(x,y)N(x,y)$ $\overline{M}(x,y)=h(x,y)M(x,y)$ (2.10.5)

and

 $\overline{M}_y(x,y)=\overline{N}_x(x,y)$ $\overline{M}(x,y)=h(x,y)M(x,y)$ (2.10.6)

Take the derivative of $\overline{M}(x,y)$ and $\overline{N}(x,y)$ with respect to $y$ and $x$ respectively:

 $\overline{M}_y(x,y)=h_y(x,y)M(x,y)+h(x,y)M_y(x,y)$ (2.10.7)
 $\overline{N}_x(x,y)=h_x(x,y)N(x,y)+h(x,y)N_x(x,y)$ (2.10.8)

Let the above two terms equal to each other:

 $h_y(x,y)M(x,y)+h(x,y)M_y(x,y)=h_x(x,y)N(x,y)+h(x,y)N_x(x,y)$ (2.10.9)

We further assume that $h=h(x)$, namely $h$ is only the function of $x$. Then after plugging the expression of $M_y$ and $N_x$ into the equation, we have:

 $\frac{1}{x}h(x)=h_x(x)N=h_x(x)$ (2.10.10)
 $\frac{h_x(x)}{h(x)}=\frac{1}{x}$ (2.10.11)

Recall that

 $h_x(x)=\frac{dh}{dx}$ (2.10.12)

Then the equation becomes:

 $\frac{dh}{h}=\frac{dx}{x}$ (2.10.13)

We integrate both side of the equation:

 $\int_{-\infty }^{h}\frac{dh}{h}=\int_{-\infty }^{x} \frac{dx}{x}$ (2.10.14)
 $ln(h(x))=lnx+C,$ (2.10.15)

where $C$ is the integral constant.

 $h(x)=e^{C}x=C_1x$ (2.10.16)

Then

 $\overline M(x,y)+\overline N(x,y)y'=0$ (2.10.17)
 $h(x)M(x,y)+h(x)N(x,y)y'=0$ (2.10.18)
 $h(x)(\frac{1}{x}y-x^2)+h(x)y'=0$ (2.10.19)

Note that

 $\frac{h_x(x)}{h(x)}=\frac{1}{x}$ (2.10.20)

 $h(x)=xh_x(x)$ (2.10.21)

Plug it into the first term of the equation to replace $h(x)$ with $xh_x(x)$:

 $(xh_x(x))(\frac{1}{x}y-x^2)+h(x)y'=0$ (2.10.22)

We reorganize it to be:

 $h_x(x)y+h(x)y'-x^3=0$ (2.10.23)
 $(h(x)y)'=h(x)x^2=C_1x^3$ (2.10.24)

Then we can integrate both side of the equation with respect to x:

 $h(x)y=\int_{-\infty }^{x}C_1x^3=\frac{1}{4}C_1x^4+C_2$ (2.10.25)
 $y=\frac{1}{h(x)}(\frac{1}{4}C_1x^4+C_2)$ (2.10.26)

 $=\frac{1}{C_1x}(\frac{1}{4}C_1x^4+C_2)$ (2.10.27)

 $=\frac{1}{4}x^3+\frac{C_2}{C_1x}$ (2.10.28)

If we let the constant $k=\frac{C_2}{C_1}$, then we can get the required form of $y(x)$:

 $y(x)=\frac{1}{4}x^3+\frac{k}{x}$ (2.10.29)

For the required expression of $h(x)=C_1x$, we can let the integral constant $C_1=1$, then:

 $h(x)=C_1x=x$ (2.10.30)

Thus, we have shown the expression of both $h(x)$ and $y(x)$ as required.