# Second Order DE

#### idontknow

Solve $$\displaystyle (x-1)y''-xy'+y=x^2-2x+1$$.
The solution is $$\displaystyle y=C_1 x +C_2 e^{x} -x^2 -x -1$$.
any hint or shortcut ?

My thoughts are to consider the particular solution $$\displaystyle y_p$$ as a polynomial, after that we find the other solution by $$\displaystyle y_2 / y_p = \int y_{p}^{-2}\cdot \mu(x) dx \;$$ where $$\displaystyle \mu$$ is the integrating factor of equation $$\displaystyle -xy' +y=0$$. The general solution is $$\displaystyle y=y_p +y_h +y_2$$.
Can we continue this way?

Last edited:

#### tahirimanov19

Are you sure the solution is right???

Could it be $ax+be^x+c-x^2$

I think $-x$ should be in solution.

#### tahirimanov19

Are you sure the solution is right???

Could it be $ax+be^x+c-x^2$

I think $-x$ should be in solution.
SORRY...

I think $-x$ shouldn't be in solution.

1 person

#### idontknow

By finding $$\displaystyle y_h$$ and then replace $$\displaystyle c_1 = a(x)$$ and $$\displaystyle c_2 = b(x)$$ to the equation (*) we find $$\displaystyle y_p$$.
So the solution must be $$\displaystyle y=y_h + y_p .$$

#### skipjack

Forum Staff
Dividing the original equation by $(x - 1)^2$ gives $(x - 1)^{-1}y'' - (x(x - 1)^{-2})y' + (x - 1)^{-2}y = 1$.
(One can check later that $x = 1$ isn't an issue.)
Integrating gives $(x - 1)^{-1}y' - (x - 1)^{-1}y + \text{B} = x$, where $\text{B}$ is a constant.
Hence $e^{-x}y' - e^{-x}y = (x - \text{B})(x - 1)e^{-x}$.
Integrating gives $e^{-x}y = \left(Bx - x^2 - x - 1\right)e^{-x} + \text{C}$, where $\text{C}$ is a constant.
Multiplying by $e^x$ and rearranging gives $y = \text{B}x + \text{C}e^x - x^2 - x - 1$.
As there's already a $\text{B}x$ term, the $-x$ term is optional.

1 person

#### idontknow

Solved , Post #5 .

#### idontknow

SORRY...

I think $-x$ shouldn't be in solution.
$$\displaystyle -x$$ is optional since $$\displaystyle Bx-x \equiv x(B+1)-x=Bx$$.

#### idontknow

By finding $$\displaystyle y_h$$ and then replace $$\displaystyle c_1 = a(x)$$ and $$\displaystyle c_2 = b(x)$$ to the equation (*) we find $$\displaystyle y_p$$.
So the solution must be $$\displaystyle y=y_h + y_p .$$
Solution of $$\displaystyle \displaystyle (x-1)y_{h}''-xy_{h} '+y_h =0$$ is $$\displaystyle y_h =c_1 x +c_2 e^{x} \: \Rightarrow \: y_p =xc_1 (x) +e^{x} c_2 (x)$$.

$$\displaystyle \begin{cases}xc_1 (x) +e^{x} c_2 (x)=0 \\ c_1 (x) +e^{x} c_2 (x)=x-1\end{cases} \; \Rightarrow \begin{cases}c_1 (x) =A-x \\ c_2 (x) =B-(x+1)e^{-x}\end{cases}$$ .

Substitute $$\displaystyle c_1 (x) , c_2 (x)$$ to equation $$\displaystyle y_p=xc_1 (x) +c_2 (x)e^{x}$$ , then $$\displaystyle y_p = -x^2 -x -1$$.
The general solution is $$\displaystyle y=y_h + y_p =Ax+Be^{x}-x^2 -x -1$$.