# Thread: Differential equation general solution - question 3

1. ## Differential equation general solution - question 3

I have the differential equation

>>(x-2)^2 dY/dX - xy + 2y = (x-2)^4

and i need to solve given y(4) = 10. I believe i have to solve it using an intergrating factor?? I have also simplified to:

>> dy/dx - xy + 2y = (x-2)^2 but believe i cannot divide by (x-2)^4 ??

also would the intergrating factor be 1/x??

\displaystyle \displaystyle \begin{align*}(x - 2)^2\frac{dy}{dx} - xy + 2y &= (x - 2)^4 \\ (x - 2)^2\frac{dy}{dx} - (x - 2)y &= (x - 2)^4 \\ \frac{dy}{dx} - \left(x-2\right)^{-1}y &= (x - 2)^2 \end{align*}
This is first order linear, so multiply both sides by the integrating factor $\displaystyle \displaystyle e^{\int{-\left(x-2\right)^{-1}\,dx}} = e^{-\ln{(x-2)}} = e^{\ln{(x-2)^{-1}}} = (x - 2)^{-1}$ to get
\displaystyle \displaystyle \begin{align*} (x - 2)^{-1}\frac{dy}{dx} - (x - 2)^{-2}y &= x - 2 \\ \frac{d}{dx}\left[(x - 2)^{-1}y\right] &= x - 2 \\ (x - 2)^{-1}y &= \int{x - 2\,dx} \\ (x - 2)^{-1}y &= \frac{x^2}{2} - 2x + C \\ y &= (x - 2)\left(\frac{x^2}{2} - 2x + C\right) \end{align*}