Please solve this...
$\displaystyle x^2\frac{d^2 y}{dx} - 2x(1+x)\frac{dy}{dx}+2(1+x)y=x^2$
I need solution of this equation..
Deviding both terms by $\displaystyle x^{2}$ the DE becomes...
$\displaystyle y^{''} - 2\cdot \frac{1+x}{x}\cdot y^{'} + 2\cdot \frac{1+x}{x^{2}}\cdot y = 1$ (1)
First step is the solution of 'incomplete equation' ...
$\displaystyle y^{''} - 2\cdot \frac{1+x}{x}\cdot y^{'} + 2\cdot \frac{1+x}{x^{2}}\cdot y = 0$ (2)
... that is of the type...
$\displaystyle y^{''} + p(x) \cdot y^{'} + q(x)\cdot y = 0$ (3)
A DE like (3) can often be solved in terms of an auxiliary function $\displaystyle u(x)$ defined as...
$\displaystyle \ln y = \ln u -\frac{1}{2}\cdot \int p(x)\cdot dx$ (4)
Deriving both terms of (4) we obtain first ...
$\displaystyle \frac {y^{'}}{y} = \frac{u^{'}}{u} - \frac{1}{2}\cdot p(x)$ (5)
... deriving again...
$\displaystyle \frac{y\cdot y^{''}}{y^{2}} - (\frac{y^{'}}{y})^{2}= \frac{u\cdot u^{''}}{u^{2}} - (\frac{u^{'}}{u})^{2} - \frac{1}{2}\cdot p^{'} (x) $ (6)
... and then with two more steps...
$\displaystyle \frac{y^{''}}{y}= \frac{u^{''}}{u}+\frac{1}{4}\cdot p^{2}(x) -\frac{1}{2}\cdot p^{‘}(x) $ (7)
Taking into account (7) the (3) can be written in terms of $\displaystyle u(x)$ as...
$\displaystyle u^{''} + \theta(x)\cdot u =0$ (8)
... where...
$\displaystyle \theta(x)= q(x) - \frac{1}{4}\cdot p^{2}(x) -\frac{1}{2}\cdot p^{'}(x) $ (9)
A little pause before proceeding...
Kind regards
$\displaystyle \chi$ $\displaystyle \sigma$
In the last post we have 'attacked' the 'incomplete' DE...
$\displaystyle y^{''} - 2\cdot \frac{1+x}{x}\cdot y^{'} + 2\cdot \frac{1+x}{x^{2}}\cdot y = 0$ (1)
... swapping the y with the u variable defined as...
$\displaystyle \ln y = \ln u -\frac{1}{2}\cdot \int p(x)\cdot dx$ (2)
... and we are arrived to the DE...
$\displaystyle u^{''} + \theta(x)\cdot u= 0$ (3)
... where...
$\displaystyle \theta (x)= q(x) - \frac{1}{4}\cdot p^{2} (x) - \frac{1}{2}\cdot p^{'} (x) $ (4)
In our case we have...
$\displaystyle p(x)= -2\cdot (1+\frac{1}{x})$, $\displaystyle q(x)= \frac{2}{x}\cdot (1+\frac{1}{x})$ (5)
... so that...
$\displaystyle y= u\cdot x\cdot e^{x}$ , $\displaystyle \theta(x)=-1$ (6)
The (6) shows us that the solution of (1) in terms of $\displaystyle u$ is relatively 'easy' and is...
$\displaystyle u(x)= c_{1}\cdot e^{-x}+ c_{2}\cdot e^{x}$ (7)
... so that is...
$\displaystyle y(x)= c_{1}\cdot x+c_{2}\cdot x\cdot e^{2x}$ (8)
The solution of the 'complete' DE is left for further study...
Kind regards
$\displaystyle \chi$ $\displaystyle \sigma$
Just a note. Sometimes a clever substitution works very well. Your ODE can be written as
$\displaystyle x^2\frac{d^2 y}{dx} - 2(1+x)\left( x \frac{dy}{dx} - y\right)=x^2$.
If you let
$\displaystyle
u = x \frac{dy}{dx} - y\;\;\;(1)
$ then your entire problem reduces to
$\displaystyle x \frac{du}{dx} - 2(x+1)u = x^2$ a linear ODE! Once you solve this then go to (1) and solve again a linear ODE.
Continuing with Chisigma's solution, then I'll finish it if that's alright. I'll use variation of parameter:
Then $\displaystyle u(x)=c_1 e^{x}+c_2 e^{-x}$ and therefore $\displaystyle y(x)=\left(c_1 e^{x}+c_2 e^{-x}\right) \exp\left(\int_x (1/z+1)dz\right)=\left(c_1 e^{x}+c_2 e^{-x}\right) xe^{x}=c_1 x e^{2x}+c_2 x$
Let $\displaystyle y(x)=A(x) xe^{2x}+B(x) x$
Substituting that into the original DE we obtain the following two equations to solve:
$\displaystyle A'xe^{2x}+B'x=0$
$\displaystyle A'(2xe^{2x}+e^{2x})+B'=x^2$
Then $\displaystyle B'=-A'e^{2x}$
Substituting that one into the second one, I get $\displaystyle A'=1/2x e^{-2x}$ or $\displaystyle B'=-1/2 x$ so that $\displaystyle B(x)=-1/4 x^2$ and $\displaystyle A(x)=-1/8 e^{-2x}-1/4 x e^{-2x}$ in which we drop the arbitrary constants in this case since we're only looking for a particular solution to add to the complimentary solution.
Therefore, the general solution is $\displaystyle y(x)=c_1 xe^{2x}+c_2 x-1/4 x^3+xe^{2x}\left(-1/8 e^{-2x}-1/4 x e^{-2x}\right)$
or:
$\displaystyle y(x)=c_1 x e^{2x}+c_2 x-1/4 x^3-1/4 x^2$