Reduction of order of differential equation! Given that y=x is a solution to the following differential equation 
$$(x^2-x+1)\frac{d^2y}{dx^2}-(x^2+x)\frac{dy}{dx}+(x+1)y=0$$
Find a linearly independent solution to the new differential equation by reducing the order. Write a general solution.
I am stuck somewhere here.
My work is below!
Suppose that $f(x)=x$ is a non trivial solution to the differential equation then by the transformation $y=vx$
$$\frac{dy}{dx}=v+x\frac{dv}{dx}$$
$$\frac{d^2y}{dx^2}=2\frac{dv}{dx}+x\frac{d^2v}{dx^2}$$
$$ (x^2-x+1)(2\frac{dv}{dx}+x\frac{d^2v}{dx^2})-(x^2+x)(v+x\frac{dv}{dx})+(x+1)(vx)=0$$
$$ 2((x^2-x+1))\frac{dv}{dx}+x((x^2-x+1))\frac{d^2v}{dx^2}-(x^2+x)(x)\frac{dv}{dx})=0$$
$$x((x^2-x+1))\frac{d^2v}{dx^2}+(-x^3+x^2-2x+2)\frac{dv}{dx}=0 $$
By letting $$w=\frac{dv}{dx}$$ ,$$\frac{dw}{dx}=\frac{d^2v}{dx^2}$$ 
$$x(x^2-x+1))\frac{dw}{dx}+(-x^3+x^2-2x+2)w=0 $$
$$\frac{dw}{dx}+\frac{(-x^3+x^2-2x+2)}{x(x^2-x+1))}w=0 $$
$$\int \frac{dw}{w}+ \int \frac{2}{x} -1- \frac{2x-1}{x^2-x+1} dx=0 $$
$$ ln|{w}|+ ln|{x}^2| -x- ln{x^2-x+1} =c $$
$$ ln|{w}|+ ln|{x}^2|- ln{x^2-x+1} =c+x $$
$$\frac{wx^2}{x^2-x+1}=ce^x$$
Choosing c=1 as the solution to the differential equation.
$$\frac{dv}{dx}=\frac{e^x(x^2-x+1)}{x^2}$$
Is this right?

We are given
$$\tag 1 (x^2-x+1) y'' - (x^2 + x) y' + (x+1) y = 0$$
You made a good Reduction of Order substitution using $y = v x \implies y' = v + v' x$ and we reduce $(1)$ to
$$\tag 2 x(x^2-x+1)\dfrac{d^2v}{dx^2}+(-x^3+x^2-2x+2)\dfrac{dv}{dx}=0$$
Next, you correctly let $\dfrac{dv}{dx} = w$ and reducing $(2)$ we get a Separable Equation that we can integrate as
$$\tag 3 \displaystyle \int \dfrac{1}{w} ~dw = \int -\dfrac{(-x^3+x^2-2x+2)}{x(x^2-x+1))}~dx = \int \left(\dfrac{2x-1}{x^2-x+1}-\dfrac{2}{x}+1\right)dx=0$$
Integrating $(3)$ results in
$$\ln w = \ln(x^2-x+1) -2 \ln x + x + c$$
Solving for $w$
$$\tag 4 w = \dfrac{c~e^x(x^2-x+1)}{x^2}$$
From the original substitution $\dfrac{dv}{dx} = w$, we now have a Separable Equation and can integrate 
$$\displaystyle \int dv = \int \dfrac{c~e^x(x^2-x+1)}{x^2}~dx$$
We get
$$v(x) = c ~ e^x \left(1 - \dfrac{1}{x}\right) + k$$
We now substitute back our original $y = v x$ and have
$$y(x) = c ~ e^x(x - 1) + k x$$
