$$xy'' + 2y' - xy = e^x$$
is the equation. Here's what I did:
Divide by x
First, solve the homogenous equation.
$$y'' + \frac{2}{x}y' - y =0$$
Perform a substitution $y=u(x) \cdot z(x)$, where $u(x) = e^{-\frac{1}{2}\int{p(x)dx}}$
In this case, $p(x) = \frac{2}{x}$, and $q(x) = -1$
Find $u', u''$
After plugging in the necessary values, we get an equation: $$z'' - z = 0$$, the solution of which is $$C_1e^x + C_2e^{-x}$$
We plug this in $y=u\cdot z$ and get:
$$y=C_1 \frac{e^x}{x} + C_2 \frac{e^{-x}}{x}$$
I am fairly sure I made no mistakes up until this point. Next, I tried to solve the equation by variation of constants, where I get the Wronskian $-\frac{2}{x^2}$.
Thus, $C_1' = \frac{1}{2}$, so $C_1 = \frac{x}{2} + C_3$
And $C_2' = -\frac{e^{2x}}{2}$, so $C_2 = -\frac{e^{2x}}{4} + C_4$
When I plug in these values into $y$, I get
$$y=\frac{e^x}{2} + C_3 \frac{e^x}{x} - \frac{e^x}{4x} + C_4\frac{e^{-x}}{x}$$
Now, when I check the solution on WolframAlpha, the third term in my solution is extra. Can anyone spot my mistake because I am unable to do so? I have been trying for at least several hours.
NOTE: It is imperative for this exercise to be done with variation of constants.