Find the differential equation given a fundamental set with no exponential name

My question is, given the general solution $$Y=C_1x+c_2\dfrac{1}{x}$$ find the differential equation

My attempt:

I have derivated the equation and then look for the constants:

$$Y'=C_1+c_2\dfrac{-1}{x^2}$$ $$Y''=c_2\dfrac{2}{x^3}$$

so $$c_2=y''\dfrac{x^3}{2}$$
and substitute in $$y'$$: $$c_1=y'+\dfrac{y''x}{2}$$
then $$y=(y'+\dfrac{y''x}{2})x+(y''\dfrac{x^3}{2})(\dfrac{1}{x})$$

and the equation its suppose to be

$$y''x^2+y'x=0$$

but when i solve it, it doesn't check with the general solution given, so, can someone please tell me what I'm doing wrong?

Thanks.

Given that $$Y=C_1x+C_2\dfrac{1}{x}\implies xY=C_1 x^2+C_2$$

Differentiating with respect to $$x$$,

$$Y+xY'=2xC_1$$ . . . . .$$(1)$$

Again differentiating with respect to $$x$$,

$$Y'+Y'+xY''=2C_1\implies 2C_1=xY''+2Y'$$

Putting the value of $$2C_1$$ in equation $$(1)$$ we have ,

$$Y+xY'=x(xY''+2Y')\implies x^2Y''+xY'-Y=0$$

This is the required differential equation.

If you want to cross-check the result, then take $$x^2Y''+xY'-Y=0 \quad. . . . (2)$$

Putting $$x=e^z\implies z=\log x$$

Then $$Y'=\frac{dY}{dx}=\frac{dY}{dz}\frac{dz}{dx}=\frac{1}{x}\frac{dY}{dz}\implies xY'=\frac{dY}{dz}=DY$$(say), where $$D\equiv \frac{d}{dz}$$

similarly, $$x^2Y''=D(D-1)Y$$

Now from $$(2)$$,

$$\{D(D-1)+D-1\}Y=0\implies (D^2-1)Y=0\implies Y=C_1 e^z+C_2e^{-z}\implies Y=C_1 x+C_2 \frac{1}{x}$$

where $$C_1$$ and $$C_2$$ are arbitrary independent constants.

Hence the result holds.

Note that if $$y_h=c_1x+c_2/x$$ implies that $$y_1=x$$ and $$y_2=1/x$$ are solutions of: $$y''+P(x)y'+Q(x)y=0$$ Then $$\begin{cases} (y_1)'' + P(x)(y_1)' + Q(x)y_1=0 \\ (y_2)'' + P(x)(y_2)' + Q(x)y_2=0\end{cases}$$ $$\begin{cases} 0+ P(x) + Q(x)x=0\implies P(x)=-xQ(x) \\ \frac{2}{x^3} -P(x)\frac{1}{x^2}+ Q(x)\frac{1}{x}=0\end{cases}$$

$$\begin{cases} 0+ P(x) + Q(x)x=0\implies P(x)=-xQ(x) \\ \frac{2}{x^2} -(-xQ(x)\frac{1}{x})+ Q(x)=0\end{cases}$$ Then $$Q(x)=\frac{-1}{x^2}\implies P(x)=\frac{1}{x}$$ So $$y''+P(x)y'+Q(x)y=0$$ $$y''+\frac{y'}{x}-\frac{y}{x^2}=0$$ $$x^2y''+xy'-y=0$$

Note that $$xy'=c_1x-\frac{c_2}x$$ which is the given solution up to a sign change. Thus repeating this combination of operations $$x(xy')'=c_1x+\frac{c_2}x$$ returns the original solution. Thus the differential equation is $$0=x(xy')'-y=x^2y''+xy'-y.$$