3.436 problem 1442

3.436.1 Solving as second order change of variable on y method 2 ode
3.436.2 Solving as second order ode non constant coeff transformation on B ode

Internal problem ID [9769]
Internal file name [OUTPUT/8711_Monday_June_06_2022_05_18_29_AM_48183895/index.tex]

Book: Differential Gleichungen, E. Kamke, 3rd ed. Chelsea Pub. NY, 1948
Section: Chapter 2, linear second order
Problem number: 1442.
ODE order: 2.
ODE degree: 1.

The type(s) of ODE detected by this program : "second_order_change_of_variable_on_y_method_2", "second_order_ode_non_constant_coeff_transformation_on_B"

Maple gives the following as the ode type

[[_2nd_order, _with_linear_symmetries]]

\[ \boxed {y^{\prime \prime }+\frac {x y^{\prime }}{f \left (x \right )}-\frac {y}{f \left (x \right )}=0} \]

3.436.1 Solving as second order change of variable on y method 2 ode

In normal form the ode \begin {align*} y^{\prime \prime } f \left (x \right )+x y^{\prime }-y&=0 \tag {1} \end {align*}

Becomes \begin {align*} y^{\prime \prime }+p \left (x \right ) y^{\prime }+q \left (x \right ) y&=0 \tag {2} \end {align*}

Where \begin {align*} p \left (x \right )&=\frac {x}{f \left (x \right )}\\ q \left (x \right )&=-\frac {1}{f \left (x \right )} \end {align*}

Applying change of variables on the depndent variable \(y = v \left (x \right ) x^{n}\) to (2) gives the following ode where the dependent variables is \(v \left (x \right )\) and not \(y\). \begin {align*} v^{\prime \prime }\left (x \right )+\left (\frac {2 n}{x}+p \right ) v^{\prime }\left (x \right )+\left (\frac {n \left (n -1\right )}{x^{2}}+\frac {n p}{x}+q \right ) v \left (x \right )&=0 \tag {3} \end {align*}

Let the coefficient of \(v \left (x \right )\) above be zero. Hence \begin {align*} \frac {n \left (n -1\right )}{x^{2}}+\frac {n p}{x}+q&=0 \tag {4} \end {align*}

Substituting the earlier values found for \(p \left (x \right )\) and \(q \left (x \right )\) into (4) gives \begin {align*} \frac {n \left (n -1\right )}{x^{2}}+\frac {n}{f \left (x \right )}-\frac {1}{f \left (x \right )}&=0 \tag {5} \end {align*}

Solving (5) for \(n\) gives \begin {align*} n&=1 \tag {6} \end {align*}

Substituting this value in (3) gives \begin {align*} v^{\prime \prime }\left (x \right )+\left (\frac {2}{x}+\frac {x}{f \left (x \right )}\right ) v^{\prime }\left (x \right )&=0 \\ v^{\prime \prime }\left (x \right )+\left (\frac {2}{x}+\frac {x}{f \left (x \right )}\right ) v^{\prime }\left (x \right )&=0 \tag {7} \\ \end {align*}

Using the substitution \begin {align*} u \left (x \right ) = v^{\prime }\left (x \right ) \end {align*}

Then (7) becomes \begin {align*} u^{\prime }\left (x \right )+\left (\frac {2}{x}+\frac {x}{f \left (x \right )}\right ) u \left (x \right ) = 0 \tag {8} \\ \end {align*}

The above is now solved for \(u \left (x \right )\). In canonical form the ODE is \begin {align*} u' &= F(x,u)\\ &= f( x) g(u)\\ &= -\frac {u \left (x^{2}+2 f \left (x \right )\right )}{f \left (x \right ) x} \end {align*}

Where \(f(x)=-\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}\) and \(g(u)=u\). Integrating both sides gives \begin {align*} \frac {1}{u} \,du &= -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x} \,d x\\ \int { \frac {1}{u} \,du} &= \int {-\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x} \,d x}\\ \ln \left (u \right )&=\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x +c_{1}\\ u&={\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x +c_{1}}\\ &=c_{1} {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} \end {align*}

Now that \(u \left (x \right )\) is known, then \begin {align*} v^{\prime }\left (x \right )&= u \left (x \right )\\ v \left (x \right )&= \int u \left (x \right )d x +c_{2}\\ &= \int c_{1} {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x}d x +c_{2} \end {align*}

Hence \begin {align*} y&= v \left (x \right ) x^{n}\\ &= \left (\int c_{1} {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x}d x +c_{2} \right ) x\\ &= \left (c_{1} \left (\int {\mathrm e}^{-\left (\int \frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x \right )}d x \right )+c_{2} \right ) x\\ \end {align*}

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= \left (\int c_{1} {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x}d x +c_{2} \right ) x \\ \end{align*}

Verification of solutions

\[ y = \left (\int c_{1} {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x}d x +c_{2} \right ) x \] Verified OK.

3.436.2 Solving as second order ode non constant coeff transformation on B ode

Given an ode of the form \begin {align*} A y^{\prime \prime } + B y^{\prime } + C y &= F(x) \end {align*}

This method reduces the order ode the ODE by one by applying the transformation \begin {align*} y&= B v \end {align*}

This results in \begin {align*} y' &=B' v+ v' B \\ y'' &=B'' v+ B' v' +v'' B + v' B' \\ &=v'' B+2 v'+ B'+B'' v \end {align*}

And now the original ode becomes \begin {align*} A\left ( v'' B+2v'B'+ B'' v\right )+B\left ( B'v+ v' B\right ) +CBv & =0\\ ABv'' +\left ( 2AB'+B^{2}\right ) v'+\left (AB''+BB'+CB\right ) v & =0 \tag {1} \end {align*}

If the term \(AB''+BB'+CB\) is zero, then this method works and can be used to solve \[ ABv''+\left ( 2AB' +B^{2}\right ) v'=0 \] By Using \(u=v'\) which reduces the order of the above ode to one. The new ode is \[ ABu'+\left ( 2AB'+B^{2}\right ) u=0 \] The above ode is first order ode which is solved for \(u\). Now a new ode \(v'=u\) is solved for \(v\) as first order ode. Then the final solution is obtain from \(y=Bv\).

This method works only if the term \(AB''+BB'+CB\) is zero. The given ODE shows that \begin {align*} A &= f \left (x \right )\\ B &= x\\ C &= -1\\ F &= 0 \end {align*}

The above shows that for this ode \begin {align*} AB''+BB'+CB &= \left (f \left (x \right )\right ) \left (0\right ) + \left (x\right ) \left (1\right ) + \left (-1\right ) \left (x\right ) \\ &=0 \end {align*}

Hence the ode in \(v\) given in (1) now simplifies to \begin {align*} f \left (x \right ) x v'' +\left ( x^{2}+2 f \left (x \right )\right ) v' & =0 \end {align*}

Now by applying \(v'=u\) the above becomes \begin {align*} f \left (x \right ) x u^{\prime }\left (x \right )+\left (x^{2}+2 f \left (x \right )\right ) u \left (x \right ) = 0 \end {align*}

Which is now solved for \(u\). In canonical form the ODE is \begin {align*} u' &= F(x,u)\\ &= f( x) g(u)\\ &= -\frac {\left (x^{2}+2 f \left (x \right )\right ) u}{f \left (x \right ) x} \end {align*}

Where \(f(x)=-\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}\) and \(g(u)=u\). Integrating both sides gives \begin {align*} \frac {1}{u} \,du &= -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x} \,d x\\ \int { \frac {1}{u} \,du} &= \int {-\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x} \,d x}\\ \ln \left (u \right )&=\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x +c_{1}\\ u&={\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x +c_{1}}\\ &=c_{1} {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} \end {align*}

The ode for \(v\) now becomes \begin {align*} v' &= u\\ &=c_{1} {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} \end {align*}

Which is now solved for \(v\). Writing the ode as \begin {align*} v^{\prime }\left (x \right )&=c_{1} {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x}\\ v^{\prime }\left (x \right )&= \omega \left ( x,v\right ) \end {align*}

The condition of Lie symmetry is the linearized PDE given by \begin {align*} \eta _{x}+\omega \left ( \eta _{v}-\xi _{x}\right ) -\omega ^{2}\xi _{v}-\omega _{x}\xi -\omega _{v}\eta =0\tag {A} \end {align*}

The type of this ode is not in the lookup table. To determine \(\xi ,\eta \) then (A) is solved using ansatz. Making bivariate polynomials of degree 1 to use as anstaz gives \begin{align*} \tag{1E} \xi &= v a_{3}+x a_{2}+a_{1} \\ \tag{2E} \eta &= v b_{3}+x b_{2}+b_{1} \\ \end{align*} Where the unknown coefficients are \[ \{a_{1}, a_{2}, a_{3}, b_{1}, b_{2}, b_{3}\} \] Substituting equations (1E,2E) and \(\omega \) into (A) gives \begin{equation} \tag{5E} b_{2}+c_{1} {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} \left (b_{3}-a_{2}\right )-c_{1}^{2} {\mathrm e}^{\int -\frac {2 \left (x^{2}+2 f \left (x \right )\right )}{f \left (x \right ) x}d x} a_{3}+\frac {c_{1} \left (x^{2}+2 f \left (x \right )\right ) {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} \left (v a_{3}+x a_{2}+a_{1}\right )}{f \left (x \right ) x} = 0 \end{equation} Putting the above in normal form gives \[ -\frac {c_{1}^{2} {\mathrm e}^{\int -\frac {2 \left (x^{2}+2 f \left (x \right )\right )}{f \left (x \right ) x}d x} a_{3} f \left (x \right ) x -{\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} c_{1} v \,x^{2} a_{3}-{\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} c_{1} x^{3} a_{2}-2 f \left (x \right ) {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} c_{1} v a_{3}-c_{1} {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} f \left (x \right ) x a_{2}-c_{1} {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} f \left (x \right ) x b_{3}-{\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} c_{1} x^{2} a_{1}-2 f \left (x \right ) {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} c_{1} a_{1}-b_{2} f \left (x \right ) x}{f \left (x \right ) x} = 0 \] Setting the numerator to zero gives \begin{equation} \tag{6E} -c_{1}^{2} {\mathrm e}^{\int -\frac {2 \left (x^{2}+2 f \left (x \right )\right )}{f \left (x \right ) x}d x} a_{3} f \left (x \right ) x +{\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} c_{1} v \,x^{2} a_{3}+{\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} c_{1} x^{3} a_{2}+2 f \left (x \right ) {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} c_{1} v a_{3}+c_{1} {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} f \left (x \right ) x a_{2}+c_{1} {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} f \left (x \right ) x b_{3}+{\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} c_{1} x^{2} a_{1}+2 f \left (x \right ) {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} c_{1} a_{1}+b_{2} f \left (x \right ) x = 0 \end{equation} Simplifying the above gives \begin{equation} \tag{6E} -c_{1}^{2} {\mathrm e}^{2 \left (\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x \right )} a_{3} f \left (x \right ) x +{\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} c_{1} v \,x^{2} a_{3}+{\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} c_{1} x^{3} a_{2}+2 f \left (x \right ) {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} c_{1} v a_{3}+c_{1} {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} f \left (x \right ) x a_{2}+c_{1} {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} f \left (x \right ) x b_{3}+{\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} c_{1} x^{2} a_{1}+2 f \left (x \right ) {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} c_{1} a_{1}+b_{2} f \left (x \right ) x = 0 \end{equation} Looking at the above PDE shows the following are all the terms with \(\{v, x\}\) in them. \[ \left \{v, x, \int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x, {\mathrm e}^{2 \left (\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x \right )}, {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x}, f \left (x \right )\right \} \] The following substitution is now made to be able to collect on all terms with \(\{v, x\}\) in them \[ \left \{v = v_{1}, x = v_{2}, \int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x = v_{3}, {\mathrm e}^{2 \left (\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x \right )} = v_{4}, {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} = v_{5}, f \left (x \right ) = v_{6}\right \} \] The above PDE (6E) now becomes \begin{equation} \tag{7E} -c_{1}^{2} a_{3} v_{2} v_{4} v_{6}+c_{1} a_{2} v_{2}^{3} v_{5}+c_{1} a_{3} v_{1} v_{2}^{2} v_{5}+c_{1} a_{1} v_{2}^{2} v_{5}+c_{1} a_{2} v_{2} v_{5} v_{6}+2 c_{1} a_{3} v_{1} v_{5} v_{6}+c_{1} b_{3} v_{2} v_{5} v_{6}+2 c_{1} a_{1} v_{5} v_{6}+b_{2} v_{6} v_{2} = 0 \end{equation} Collecting the above on the terms \(v_i\) introduced, and these are \[ \{v_{1}, v_{2}, v_{3}, v_{4}, v_{5}, v_{6}\} \] Equation (7E) now becomes \begin{equation} \tag{8E} c_{1} a_{3} v_{1} v_{2}^{2} v_{5}+2 c_{1} a_{3} v_{1} v_{5} v_{6}+c_{1} a_{2} v_{2}^{3} v_{5}+c_{1} a_{1} v_{2}^{2} v_{5}-c_{1}^{2} a_{3} v_{2} v_{4} v_{6}+\left (c_{1} a_{2}+c_{1} b_{3}\right ) v_{2} v_{5} v_{6}+b_{2} v_{6} v_{2}+2 c_{1} a_{1} v_{5} v_{6} = 0 \end{equation} Setting each coefficients in (8E) to zero gives the following equations to solve \begin {align*} b_{2}&=0\\ c_{1} a_{1}&=0\\ c_{1} a_{2}&=0\\ c_{1} a_{3}&=0\\ 2 c_{1} a_{1}&=0\\ 2 c_{1} a_{3}&=0\\ -c_{1}^{2} a_{3}&=0\\ c_{1} a_{2}+c_{1} b_{3}&=0 \end {align*}

Solving the above equations for the unknowns gives \begin {align*} a_{1}&=0\\ a_{2}&=0\\ a_{3}&=0\\ b_{1}&=b_{1}\\ b_{2}&=0\\ b_{3}&=0 \end {align*}

Substituting the above solution in the anstaz (1E,2E) (using \(1\) as arbitrary value for any unknown in the RHS) gives \begin{align*} \xi &= 0 \\ \eta &= 1 \\ \end{align*} The next step is to determine the canonical coordinates \(R,S\). The canonical coordinates map \(\left ( x,v\right ) \to \left ( R,S \right )\) where \(\left ( R,S \right )\) are the canonical coordinates which make the original ode become a quadrature and hence solved by integration.

The characteristic pde which is used to find the canonical coordinates is \begin {align*} \frac {d x}{\xi } &= \frac {d v}{\eta } = dS \tag {1} \end {align*}

The above comes from the requirements that \(\left ( \xi \frac {\partial }{\partial x} + \eta \frac {\partial }{\partial v}\right ) S(x,v) = 1\). Starting with the first pair of ode’s in (1) gives an ode to solve for the independent variable \(R\) in the canonical coordinates, where \(S(R)\). Since \(\xi =0\) then in this special case \begin {align*} R = x \end {align*}

\(S\) is found from \begin {align*} S &= \int { \frac {1}{\eta }} dy\\ &= \int { \frac {1}{1}} dy \end {align*}

Which results in \begin {align*} S&= v \end {align*}

Now that \(R,S\) are found, we need to setup the ode in these coordinates. This is done by evaluating \begin {align*} \frac {dS}{dR} &= \frac { S_{x} + \omega (x,v) S_{v} }{ R_{x} + \omega (x,v) R_{v} }\tag {2} \end {align*}

Where in the above \(R_{x},R_{v},S_{x},S_{v}\) are all partial derivatives and \(\omega (x,v)\) is the right hand side of the original ode given by \begin {align*} \omega (x,v) &= c_{1} {\mathrm e}^{\int -\frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x} \end {align*}

Evaluating all the partial derivatives gives \begin {align*} R_{x} &= 1\\ R_{v} &= 0\\ S_{x} &= 0\\ S_{v} &= 1 \end {align*}

Substituting all the above in (2) and simplifying gives the ode in canonical coordinates. \begin {align*} \frac {dS}{dR} &= c_{1} {\mathrm e}^{-\left (\int \frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x \right )}\tag {2A} \end {align*}

We now need to express the RHS as function of \(R\) only. This is done by solving for \(x,v\) in terms of \(R,S\) from the result obtained earlier and simplifying. This gives \begin {align*} \frac {dS}{dR} &= c_{1} {\mathrm e}^{-\left (\int \frac {R^{2}+2 f \left (R \right )}{f \left (R \right ) R}d R \right )} \end {align*}

The above is a quadrature ode. This is the whole point of Lie symmetry method. It converts an ode, no matter how complicated it is, to one that can be solved by integration when the ode is in the canonical coordiates \(R,S\). Integrating the above gives \begin {align*} S \left (R \right ) = \int c_{1} {\mathrm e}^{-\left (\int \frac {R^{2}+2 f \left (R \right )}{f \left (R \right ) R}d R \right )}d R +c_{2}\tag {4} \end {align*}

To complete the solution, we just need to transform (4) back to \(x,v\) coordinates. This results in \begin {align*} v \left (x \right ) = \int c_{1} {\mathrm e}^{-\left (\int \frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x \right )}d x +c_{2} \end {align*}

Which simplifies to \begin {align*} v \left (x \right ) = \int c_{1} {\mathrm e}^{-\left (\int \frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x \right )}d x +c_{2} \end {align*}

Which gives \begin {align*} v \left (x \right ) = \int c_{1} {\mathrm e}^{-\left (\int \frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x \right )}d x +c_{2} \end {align*}

Therefore the solution is \begin {align*} y(x) &= B v\\ &= \left (x\right ) \left (\int c_{1} {\mathrm e}^{-\left (\int \frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x \right )}d x +c_{2}\right ) \\ &= x \left (c_{1} \left (\int {\mathrm e}^{-\left (\int \frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x \right )}d x \right )+c_{2} \right ) \end {align*}

Summary

The solution(s) found are the following \begin{align*} \tag{1} y &= x \left (c_{1} \left (\int {\mathrm e}^{-\left (\int \frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x \right )}d x \right )+c_{2} \right ) \\ \end{align*}

Verification of solutions

\[ y = x \left (c_{1} \left (\int {\mathrm e}^{-\left (\int \frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x \right )}d x \right )+c_{2} \right ) \] Verified OK.

Maple trace

`Methods for second order ODEs: 
--- Trying classification methods --- 
trying a symmetry of the form [xi=0, eta=F(x)] 
checking if the LODE is missing y 
-> Heun: Equivalence to the GHE or one of its 4 confluent cases under a power @ Moebius 
-> trying a solution of the form r0(x) * Y + r1(x) * Y where Y = exp(int(r(x), dx)) * 2F1([a1, a2], [b1], f) 
-> Trying changes of variables to rationalize or make the ODE simpler 
<- unable to find a useful change of variables 
   trying a symmetry of the form [xi=0, eta=F(x)] 
   trying 2nd order exact linear 
   trying symmetries linear in x and y(x) 
   <- linear symmetries successful`
 

Solution by Maple

Time used: 0.047 (sec). Leaf size: 33

dsolve(diff(diff(y(x),x),x) = -x/f(x)*diff(y(x),x)+1/f(x)*y(x),y(x), singsol=all)
 

\[ y \left (x \right ) = x \left (\left (\int {\mathrm e}^{-\left (\int \frac {x^{2}+2 f \left (x \right )}{f \left (x \right ) x}d x \right )}d x \right ) c_{1} +c_{2} \right ) \]

Solution by Mathematica

Time used: 0.227 (sec). Leaf size: 45

DSolve[y''[x] == y[x]/f[x] - (x*y'[x])/f[x],y[x],x,IncludeSingularSolutions -> True]
 

\[ y(x)\to x \left (c_2 \int _1^x\frac {\exp \left (-\int _1^{K[2]}\frac {K[1]}{f(K[1])}dK[1]\right )}{K[2]^2}dK[2]+c_1\right ) \]