# Problem dealing with a second-order linear ODE.

I want to solve: $$(x^2-1)y'' - 2xy' + 2y = x^2-1 \quad \quad (1)$$ Knowing that one of the solutions for $$(x^2-1)y'' -2xy' + 2y = 0 \quad \quad (2)$$ is $y_1(x) = x$. So first of all, applying D'Alembert's method: $$y_2(x) = v(x) y_1(x)$$ $$y_2' = v' x + v$$ $$y_2'' = v''x + 2v$$ Plugging in $(2)$: $$v''(x^3-x) + v'(-2) = 0$$ $$v''(x^3-x) = 2v'$$ And so, let $\mu(x) = v'(x)$, we get $\mu'= \frac{2}{x^3-x}\mu$ and hence $$\mu = e^{\int\frac{2}{x^3-x}dx}$$ Since $\int \frac{2}{x^3-x}dx = \ln(|\frac{1}{x^2} -1|)$, we get $$\mu = e^{\ln(|\frac{1}{x^2} -1|)}$$ Here is my first problem: For $|x| < 1$, i get $\mu = \frac{1-x^2}{x^2}$ and for $|x| > 1$ i get $\mu = \frac{-1+x^2}{x^2}$. Which one should i "choose"? I would work with them both (for me it seems like is the most correct thing to do), but apperently i shouldn't, because the answer to the problem doesn't specify the domain at all. The second problem appears when i try to apply the variaton of parameters method to solve the equation. This looks silly. Any ideas?

Assuming $y_2(x) = 1+x^2$: The wronskian of $y_1$ and $y_2$ is $2x^2-(1+x^2) = x^2-1$. Using Cramer's rule to solve the system of variation of parameters method: $$v_2 = \int \frac{ y_1 f(x)}{W(y_1,y_2)}dx \quad (3)$$ Where $f(x) = x^2-1$ and $W(y_1,y_2)$ is the Wronskian of $y_1$ and $y_2$. (Here, $v_2$ comes from the fact that we are assuming the existence of a particular solution to $(1)$ defined as $y_p = v_1 y_1 + v_2 y_2$ where $y_1$ and $y_2$ are solutions to $(2)$ and $v_1$ and $v_2$ are non-constant functions).

So, computing integral $(3)$: $$v_2 = \int \frac{x \cdot ( x^2-1)}{x^2-1}dx = \frac{x^2}{2}$$ And so one part of the particular solution would be $y = \frac{x^2}{2} (x^2+1)$ which i don't think it's right.

Question 'official' answer: $$y(x) = -x^2 + x \ln(\frac{1+x}{1-x}) + \frac{1}{2}(1+x^2)\ln(1-x^2) + C_1x + C_2 (x^2+1)$$

• You move from $v'=μ=\frac{1+x}{x^2}$ to $y_2=xv=1+x^2$. How did you get that, as $$v=-\frac1x+\ln|x|$$ leads to $y_2=-1+x\ln|x|$? – LutzL Jun 3 '17 at 20:08
• Answer: It should be $v'=μ=\frac{x^2-1}{x^2}$. As the assembled second solution $y_2=1+x^2$ is free of singularities at $x=\pm1$, it is valid globally. Remember that the full homogeneous solution has a factor in front of $y_2$ which includes sign variations. – LutzL Jun 3 '17 at 20:21
• Yes! I mistyped the value of $v'$.. I will correct. – Vitor C Goergen Jun 3 '17 at 20:24
• @LutzL, about the fact the factor that includes sign variations in front of $y_2$. What sign should i put in the wronksian? The positive, right? – Vitor C Goergen Jun 3 '17 at 20:27
• Your resolution of the absolute value is still not correct, a difference can not become a sum of positive terms. -- Once you fix $v_2$ as a globally continuous function, the sign problems during previous steps are hidden, do not play a further role. – LutzL Jun 3 '17 at 20:30

Somehow you missed to take the leading coefficient into account. The variation of constants approach should lead to \begin{align} v_1'y_1+v_2'y_2&=0\\ (x^2-1)(v_1'y_1'+v_2'y_2')&=(x^2-1)\\ \implies v_1'y_1'+v_2'y_2'&=1 \end{align} so that $$v_1'=\frac{-y_2}{y_1y_2'-y_1'y_2}, \quad v_2'=\frac{y_1}{y_1y_2'-y_1'y_2}$$