<s>[INST] I just need your approval Verify by susbtitution if the given functions are a solution to the next differential equations.
a) 
$$x^2y''+xy'-y=\ln x \quad ,\quad y_p=x^{-1}-\ln x $$
simplifying:
$$ x^2y''+xy'-y=\ln x $$ 
$$ x^2y''=-xy'+\ln x+y $$
$$y''=\frac{-xy'+\ln x+y}{x^2} $$
$$y_p=x^{-1}-\ln x $$ 
$$y_p'= -\frac{1}{(x)^2}-\frac{1}{x} $$
$$y_p'= \frac{-x-1}{x^2} $$ 
$$y_p''=\frac{x^2\frac{d}{dx}(-x-1)-\frac{x}{dx}(x^2).(-x-1)}{(x^2)^2} $$
$$y_p''=\frac{(x^2)(-1)-(2x)(-x-1)}{x^4} $$
$$ y_p''=\frac{(-x^2)-(-2x^2-2x)}{x^4} $$ 
$$y_p''=\frac{x^2+2x}{x^4} $$
$$y_p''=\frac{x+2}{x^3} $$
replacing:
$$y''=\frac{-x(\frac{-x-1}{x^2})+\ln x+(x^{-1}-\ln x)}{x^2} $$
$$y''=\frac{\frac{x+1}{x}+\frac{1}{x}}{x^2} $$
$$y''=\frac{\frac{x+2}{x}}{x^2} $$
$$y''=\frac{x+2}{x^3} $$
The function is a solution for the diffential equation
b)
$$y'+2xy^2=0 \quad , \quad y_p=\frac{1}{1+x^2} $$ 
simplifying: 
$$ y'=-2xy^2 $$
$$y_p'= -\frac{2x}{(x^2+1)^2} $$ 
replacing: 
$$y'=-2x(\frac{1}{1+x^2})^2 $$
$$y'=-\frac{2x}{(x^2+1)^2} $$
The function is a solution for the diffential equation
c)
$$x^2y''-xy'+2y=0 \quad , \quad y_p=x\cos(\ln x)$$  simplifying: 
$$y''=\frac{xy'-2y}{x^2} $$
$$y_p'=(\frac{d}{dx}(x))(\cos(\ln x))+x(\frac{d}{dx}(\cos(\ln x))) $$
$$y_p'=(1)(\cos(\ln x))+(x)(-\frac{\sin(\ln(x))}{x})$$
$$y_p'=\cos(\ln x)-\sin(\ln x) $$
$$y_p''=(\frac{d}{dx})\cos(\ln x)-(\frac{d}{dx})\sin(\ln x) $$
$$y_p''= -\sin(\ln x)-\cos(ln) $$
$$y_p''= -\sin(\ln x)((\frac{d}{dx})(\ln x))-\cos(\ln x)((\frac{d}{dx})(\ln x)) $$
$$y_p''= -\frac{1}{x}\sin(\ln x)-\frac{1}{x}\cos(\ln x) $$
$$y_p''= -\frac{\sin(\ln x)}{x}-\frac{\cos(\ln x)}{x} $$
$$y_p''= -\frac{\sin(\ln x)+\cos(\ln x)}{x} $$
replacing:
$$y''=\frac{x(\cos(\ln x)-\sin(\ln x))-2(x\cos(\ln x))}{x^2} $$
$$y''=\frac{x\cos(\ln x)-x\sin(\ln x)-2x\cos(\ln x)}{x^2} $$
$$y''=\frac{-x\sin(\ln x)-x\cos(\ln x)}{x^2} $$
$$y''=\frac{-\sin(\ln x)-\cos(\ln x)}{x} $$
$$y''= -\frac{\sin(\ln x)+\cos(\ln x)}{x} $$ 
The function is a solution for the diffential equation
 [/INST] You first idea is correct,
but you could do it simpler without first simplification.
Just "plug" it in...
$$
\begin{array}{ccc}
x^2  y'' & + & x y' & - & y & = & \ln(x)\\\\
\hline\\
\displaystyle x^2 \left( \frac{2}{x^3} + \frac{1}{x^2} \right) &+&
\displaystyle x \left( - \frac{1}{x^2} - \frac{1}{x} \right) &-&
\displaystyle \left( \frac{1}{x} - \ln(x) \right) &=& \ln(x)\\\\
\displaystyle \color{red}{\frac{2}{x}} + \color{blue}{1} &+&
\displaystyle \color{red}{-\frac{1}{x}} - \color{blue}{1} &+&
\displaystyle \color{red}{-\frac{1}{x}} + \color{green}{\ln(x)} &=&
\color{green}{\ln(x)}
\end{array}
$$
</s>