\(y''-5y'+6y=0\) gives with \(y(x)=\exp(ax)\) that \(a^2-5a+6=0\) that \((a-2)(a-3)=0\) that \(y(x)=A\exp(2x)+B\exp(3x)\)
\(y'+xy=x\) reads \(y'+p(x)y=q(x)\) where \(p(x)=x\) and \(q(x)=x\). Now \(P(x)=\int p(x)dx=\frac{x^2}{2}\) and \(\mu(x)=\exp(P(x)=\exp(\frac{x^2}{2})\). Therefore \(\int\mu(x)q(x)=\exp(\frac{x^2}{2})\). We have \(y(x)=C\exp(-\frac{x^2}{2})+1\)