5.5 problem 5

5.5.1 Solved as second order solved by an integrating factor
5.5.2 Solved as second order ode using change of variable on y method 1
5.5.3 Solved as second order ode using Kovacic algorithm
5.5.4 Solved as second order ode adjoint method
5.5.5 Maple step by step solution
5.5.6 Maple trace
5.5.7 Maple dsolve solution
5.5.8 Mathematica DSolve solution

Internal problem ID [7946]
Book : Own collection of miscellaneous problems
Section : section 5.0
Problem number : 5
Date solved : Monday, October 21, 2024 at 04:39:19 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

Solve

\begin{align*} 4 x^{2} y^{\prime \prime }+\left (-8 x^{2}+4 x \right ) y^{\prime }+\left (4 x^{2}-4 x -1\right ) y&=4 \sqrt {x}\, {\mathrm e}^{x} \end{align*}

5.5.1 Solved as second order solved by an integrating factor

Time used: 0.049 (sec)

The ode satisfies this form

\[ y^{\prime \prime }+p \left (x \right ) y^{\prime }+\frac {\left (p \left (x \right )^{2}+p^{\prime }\left (x \right )\right ) y}{2} = f \left (x \right ) \]

Where \( p(x) = \frac {-2 x +1}{x}\). Therefore, there is an integrating factor given by

\begin{align*} M(x) &= e^{\frac {1}{2} \int p \, dx} \\ &= e^{ \int \frac {-2 x +1}{x} \, dx} \\ &= \sqrt {x}\, {\mathrm e}^{-x} \end{align*}

Multiplying both sides of the ODE by the integrating factor \(M(x)\) makes the left side of the ODE a complete differential

\begin{align*} \left ( M(x) y \right )'' &= \frac {{\mathrm e}^{-x} {\mathrm e}^{x}}{x} \\ \left ( \sqrt {x}\, {\mathrm e}^{-x} y \right )'' &= \frac {{\mathrm e}^{-x} {\mathrm e}^{x}}{x} \\ \end{align*}

Integrating once gives

\[ \left ( \sqrt {x}\, {\mathrm e}^{-x} y \right )' = \ln \left (x \right )+c_1 \]

Integrating again gives

\[ \left ( \sqrt {x}\, {\mathrm e}^{-x} y \right ) = x \left (\ln \left (x \right )+c_1 -1\right )+c_2 \]

Hence the solution is

\begin{align*} y &= \frac {x \left (\ln \left (x \right )+c_1 -1\right )+c_2}{\sqrt {x}\, {\mathrm e}^{-x}} \\ \end{align*}

Or

\[ y = c_1 \sqrt {x}\, {\mathrm e}^{x}+\sqrt {x}\, {\mathrm e}^{x} \ln \left (x \right )+\frac {c_2 \,{\mathrm e}^{x}}{\sqrt {x}}-\sqrt {x}\, {\mathrm e}^{x} \]

Will add steps showing solving for IC soon.

5.5.2 Solved as second order ode using change of variable on y method 1

Time used: 0.440 (sec)

This is second order non-homogeneous ODE. Let the solution be

\[ y = y_h + y_p \]

Where \(y_h\) is the solution to the homogeneous ODE \( A y''(x) + B y'(x) + C y(x) = 0\), and \(y_p\) is a particular solution to the non-homogeneous ODE \(A y''(x) + B y'(x) + C y(x) = f(x)\). \(y_h\) is the solution to

\[ 4 x^{2} y^{\prime \prime }+\left (-8 x^{2}+4 x \right ) y^{\prime }+\left (4 x^{2}-4 x -1\right ) y = 0 \]

In normal form the given ode is written as

\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 {-8 x^{2}+4 x}{4 x^{2}}\\ q \left (x \right )&=\frac {4 x^{2}-4 x -1}{4 x^{2}} \end{align*}

Calculating the Liouville ode invariant \(Q\) given by

\begin{align*} Q &= q - \frac {p'}{2}- \frac {p^2}{4} \\ &= \frac {4 x^{2}-4 x -1}{4 x^{2}} - \frac {\left (\frac {-8 x^{2}+4 x}{4 x^{2}}\right )'}{2}- \frac {\left (\frac {-8 x^{2}+4 x}{4 x^{2}}\right )^2}{4} \\ &= \frac {4 x^{2}-4 x -1}{4 x^{2}} - \frac {\left (\frac {-16 x +4}{4 x^{2}}-\frac {-8 x^{2}+4 x}{2 x^{3}}\right )}{2}- \frac {\left (\frac {\left (-8 x^{2}+4 x \right )^{2}}{16 x^{4}}\right )}{4} \\ &= \frac {4 x^{2}-4 x -1}{4 x^{2}} - \left (\frac {-16 x +4}{8 x^{2}}-\frac {-8 x^{2}+4 x}{4 x^{3}}\right )-\frac {\left (-8 x^{2}+4 x \right )^{2}}{64 x^{4}}\\ &= 0 \end{align*}

Since the Liouville ode invariant does not depend on the independent variable \(x\) then the transformation

\begin{align*} y = v \left (x \right ) z \left (x \right )\tag {3} \end{align*}

is used to change the original ode to a constant coefficients ode in \(v\). In (3) the term \(z \left (x \right )\) is given by

\begin{align*} z \left (x \right )&={\mathrm e}^{-\left (\int \frac {p \left (x \right )}{2}d x \right )}\\ &= e^{-\int \frac {\frac {-8 x^{2}+4 x}{4 x^{2}}}{2} }\\ &= \frac {{\mathrm e}^{x}}{\sqrt {x}}\tag {5} \end{align*}

Hence (3) becomes

\begin{align*} y = \frac {v \left (x \right ) {\mathrm e}^{x}}{\sqrt {x}}\tag {4} \end{align*}

Applying this change of variable to the original ode results in

\begin{align*} 4 \,{\mathrm e}^{x} v^{\prime \prime }\left (x \right ) x^{{3}/{2}} = 0 \end{align*}

Which is now solved for \(v \left (x \right )\).

The above ode can be simplified to

\begin{align*} 4 v^{\prime \prime }\left (x \right ) = 0 \end{align*}

The ODE simplifies to

\[ v^{\prime \prime }\left (x \right ) = 0 \]

Integrating twice gives the solution

\[ v \left (x \right )= c_1 x + c_2 \]

Will add steps showing solving for IC soon.

Now that \(v \left (x \right )\) is known, then

\begin{align*} y&= v \left (x \right ) z \left (x \right )\\ &= \left (c_1 x +c_2\right ) \left (z \left (x \right )\right )\tag {7} \end{align*}

But from (5)

\begin{align*} z \left (x \right )&= \frac {{\mathrm e}^{x}}{\sqrt {x}} \end{align*}

Hence (7) becomes

\begin{align*} y = \frac {\left (c_1 x +c_2 \right ) {\mathrm e}^{x}}{\sqrt {x}} \end{align*}

Therefore the homogeneous solution \(y_h\) is

\[ y_h = \frac {\left (c_1 x +c_2 \right ) {\mathrm e}^{x}}{\sqrt {x}} \]

The particular solution \(y_p\) can be found using either the method of undetermined coefficients, or the method of variation of parameters. The method of variation of parameters will be used as it is more general and can be used when the coefficients of the ODE depend on \(x\) as well. Let

\begin{equation} \tag{1} y_p(x) = u_1 y_1 + u_2 y_2 \end{equation}

Where \(u_1,u_2\) to be determined, and \(y_1,y_2\) are the two basis solutions (the two linearly independent solutions of the homogeneous ODE) found earlier when solving the homogeneous ODE as

\begin{align*} y_1 &= \frac {{\mathrm e}^{x}}{\sqrt {x}} \\ y_2 &= \sqrt {x}\, {\mathrm e}^{x} \\ \end{align*}

In the Variation of parameters \(u_1,u_2\) are found using

\begin{align*} \tag{2} u_1 &= -\int \frac {y_2 f(x)}{a W(x)} \\ \tag{3} u_2 &= \int \frac {y_1 f(x)}{a W(x)} \\ \end{align*}

Where \(W(x)\) is the Wronskian and \(a\) is the coefficient in front of \(y''\) in the given ODE. The Wronskian is given by \(W= \begin {vmatrix} y_1 & y_{2} \\ y_{1}^{\prime } & y_{2}^{\prime } \end {vmatrix} \). Hence

\[ W = \begin {vmatrix} \frac {{\mathrm e}^{x}}{\sqrt {x}} & \sqrt {x}\, {\mathrm e}^{x} \\ \frac {d}{dx}\left (\frac {{\mathrm e}^{x}}{\sqrt {x}}\right ) & \frac {d}{dx}\left (\sqrt {x}\, {\mathrm e}^{x}\right ) \end {vmatrix} \]

Which gives

\[ W = \begin {vmatrix} \frac {{\mathrm e}^{x}}{\sqrt {x}} & \sqrt {x}\, {\mathrm e}^{x} \\ -\frac {{\mathrm e}^{x}}{2 x^{{3}/{2}}}+\frac {{\mathrm e}^{x}}{\sqrt {x}} & \frac {{\mathrm e}^{x}}{2 \sqrt {x}}+\sqrt {x}\, {\mathrm e}^{x} \end {vmatrix} \]

Therefore

\[ W = \left (\frac {{\mathrm e}^{x}}{\sqrt {x}}\right )\left (\frac {{\mathrm e}^{x}}{2 \sqrt {x}}+\sqrt {x}\, {\mathrm e}^{x}\right ) - \left (\sqrt {x}\, {\mathrm e}^{x}\right )\left (-\frac {{\mathrm e}^{x}}{2 x^{{3}/{2}}}+\frac {{\mathrm e}^{x}}{\sqrt {x}}\right ) \]

Which simplifies to

\[ W = \frac {{\mathrm e}^{2 x}}{x} \]

Which simplifies to

\[ W = \frac {{\mathrm e}^{2 x}}{x} \]

Therefore Eq. (2) becomes

\[ u_1 = -\int \frac {4 x \,{\mathrm e}^{2 x}}{4 x \,{\mathrm e}^{2 x}}\,dx \]

Which simplifies to

\[ u_1 = - \int 1d x \]

Hence

\[ u_1 = -x \]

And Eq. (3) becomes

\[ u_2 = \int \frac {4 \,{\mathrm e}^{2 x}}{4 x \,{\mathrm e}^{2 x}}\,dx \]

Which simplifies to

\[ u_2 = \int \frac {1}{x}d x \]

Hence

\[ u_2 = \ln \left (x \right ) \]

Therefore the particular solution, from equation (1) is

\[ y_p(x) = -\sqrt {x}\, {\mathrm e}^{x}+\sqrt {x}\, {\mathrm e}^{x} \ln \left (x \right ) \]

Which simplifies to

\[ y_p(x) = \sqrt {x}\, {\mathrm e}^{x} \left (-1+\ln \left (x \right )\right ) \]

Therefore the general solution is

\begin{align*} y &= y_h + y_p \\ &= \left (\frac {\left (c_1 x +c_2 \right ) {\mathrm e}^{x}}{\sqrt {x}}\right ) + \left (\sqrt {x}\, {\mathrm e}^{x} \left (-1+\ln \left (x \right )\right )\right ) \\ \end{align*}

Will add steps showing solving for IC soon.

5.5.3 Solved as second order ode using Kovacic algorithm

Time used: 0.204 (sec)

Writing the ode as

\begin{align*} 4 x^{2} y^{\prime \prime }+\left (-8 x^{2}+4 x \right ) y^{\prime }+\left (4 x^{2}-4 x -1\right ) y &= 0 \tag {1} \\ A y^{\prime \prime } + B y^{\prime } + C y &= 0 \tag {2} \end{align*}

Comparing (1) and (2) shows that

\begin{align*} A &= 4 x^{2} \\ B &= -8 x^{2}+4 x\tag {3} \\ C &= 4 x^{2}-4 x -1 \end{align*}

Applying the Liouville transformation on the dependent variable gives

\begin{align*} z(x) &= y e^{\int \frac {B}{2 A} \,dx} \end{align*}

Then (2) becomes

\begin{align*} z''(x) = r z(x)\tag {4} \end{align*}

Where \(r\) is given by

\begin{align*} r &= \frac {s}{t}\tag {5} \\ &= \frac {2 A B' - 2 B A' + B^2 - 4 A C}{4 A^2} \end{align*}

Substituting the values of \(A,B,C\) from (3) in the above and simplifying gives

\begin{align*} r &= \frac {0}{1}\tag {6} \end{align*}

Comparing the above to (5) shows that

\begin{align*} s &= 0\\ t &= 1 \end{align*}

Therefore eq. (4) becomes

\begin{align*} z''(x) &= 0 \tag {7} \end{align*}

Equation (7) is now solved. After finding \(z(x)\) then \(y\) is found using the inverse transformation

\begin{align*} y &= z \left (x \right ) e^{-\int \frac {B}{2 A} \,dx} \end{align*}

The first step is to determine the case of Kovacic algorithm this ode belongs to. There are 3 cases depending on the order of poles of \(r\) and the order of \(r\) at \(\infty \). The following table summarizes these cases.

Case

Allowed pole order for \(r\)

Allowed value for \(\mathcal {O}(\infty )\)

1

\(\left \{ 0,1,2,4,6,8,\cdots \right \} \)

\(\left \{ \cdots ,-6,-4,-2,0,2,3,4,5,6,\cdots \right \} \)

2

Need to have at least one pole that is either order \(2\) or odd order greater than \(2\). Any other pole order is allowed as long as the above condition is satisfied. Hence the following set of pole orders are all allowed. \(\{1,2\}\),\(\{1,3\}\),\(\{2\}\),\(\{3\}\),\(\{3,4\}\),\(\{1,2,5\}\).

no condition

3

\(\left \{ 1,2\right \} \)

\(\left \{ 2,3,4,5,6,7,\cdots \right \} \)

Table 114: Necessary conditions for each Kovacic case

The order of \(r\) at \(\infty \) is the degree of \(t\) minus the degree of \(s\). Therefore

\begin{align*} O\left (\infty \right ) &= \text {deg}(t) - \text {deg}(s) \\ &= 0 - -\infty \\ &= \infty \end{align*}

There are no poles in \(r\). Therefore the set of poles \(\Gamma \) is empty. Since there is no odd order pole larger than \(2\) and the order at \(\infty \) is \(infinity\) then the necessary conditions for case one are met. Therefore

\begin{align*} L &= [1] \end{align*}

Since \(r = 0\) is not a function of \(x\), then there is no need run Kovacic algorithm to obtain a solution for transformed ode \(z''=r z\) as one solution is

\[ z_1(x) = 1 \]

Using the above, the solution for the original ode can now be found. The first solution to the original ode in \(y\) is found from

\begin{align*} y_1 &= z_1 e^{ \int -\frac {1}{2} \frac {B}{A} \,dx} \\ &= z_1 e^{ -\int \frac {1}{2} \frac {-8 x^{2}+4 x}{4 x^{2}} \,dx} \\ &= z_1 e^{x -\frac {\ln \left (x \right )}{2}} \\ &= z_1 \left (\frac {{\mathrm e}^{x}}{\sqrt {x}}\right ) \\ \end{align*}

Which simplifies to

\[ y_1 = \frac {{\mathrm e}^{x}}{\sqrt {x}} \]

The second solution \(y_2\) to the original ode is found using reduction of order

\[ y_2 = y_1 \int \frac { e^{\int -\frac {B}{A} \,dx}}{y_1^2} \,dx \]

Substituting gives

\begin{align*} y_2 &= y_1 \int \frac { e^{\int -\frac {-8 x^{2}+4 x}{4 x^{2}} \,dx}}{\left (y_1\right )^2} \,dx \\ &= y_1 \int \frac { e^{2 x -\ln \left (x \right )}}{\left (y_1\right )^2} \,dx \\ &= y_1 \left (x\right ) \\ \end{align*}

Therefore the solution is

\begin{align*} y &= c_1 y_1 + c_2 y_2 \\ &= c_1 \left (\frac {{\mathrm e}^{x}}{\sqrt {x}}\right ) + c_2 \left (\frac {{\mathrm e}^{x}}{\sqrt {x}}\left (x\right )\right ) \\ \end{align*}

This is second order nonhomogeneous ODE. Let the solution be

\[ y = y_h + y_p \]

Where \(y_h\) is the solution to the homogeneous ODE \( A y''(x) + B y'(x) + C y(x) = 0\), and \(y_p\) is a particular solution to the nonhomogeneous ODE \(A y''(x) + B y'(x) + C y(x) = f(x)\). \(y_h\) is the solution to

\[ 4 x^{2} y^{\prime \prime }+\left (-8 x^{2}+4 x \right ) y^{\prime }+\left (4 x^{2}-4 x -1\right ) y = 0 \]

The homogeneous solution is found using the Kovacic algorithm which results in

\[ y_h = \frac {c_1 \,{\mathrm e}^{x}}{\sqrt {x}}+c_2 \sqrt {x}\, {\mathrm e}^{x} \]

The particular solution \(y_p\) can be found using either the method of undetermined coefficients, or the method of variation of parameters. The method of variation of parameters will be used as it is more general and can be used when the coefficients of the ODE depend on \(x\) as well. Let

\begin{equation} \tag{1} y_p(x) = u_1 y_1 + u_2 y_2 \end{equation}

Where \(u_1,u_2\) to be determined, and \(y_1,y_2\) are the two basis solutions (the two linearly independent solutions of the homogeneous ODE) found earlier when solving the homogeneous ODE as

\begin{align*} y_1 &= \frac {{\mathrm e}^{x}}{\sqrt {x}} \\ y_2 &= \sqrt {x}\, {\mathrm e}^{x} \\ \end{align*}

In the Variation of parameters \(u_1,u_2\) are found using

\begin{align*} \tag{2} u_1 &= -\int \frac {y_2 f(x)}{a W(x)} \\ \tag{3} u_2 &= \int \frac {y_1 f(x)}{a W(x)} \\ \end{align*}

Where \(W(x)\) is the Wronskian and \(a\) is the coefficient in front of \(y''\) in the given ODE. The Wronskian is given by \(W= \begin {vmatrix} y_1 & y_{2} \\ y_{1}^{\prime } & y_{2}^{\prime } \end {vmatrix} \). Hence

\[ W = \begin {vmatrix} \frac {{\mathrm e}^{x}}{\sqrt {x}} & \sqrt {x}\, {\mathrm e}^{x} \\ \frac {d}{dx}\left (\frac {{\mathrm e}^{x}}{\sqrt {x}}\right ) & \frac {d}{dx}\left (\sqrt {x}\, {\mathrm e}^{x}\right ) \end {vmatrix} \]

Which gives

\[ W = \begin {vmatrix} \frac {{\mathrm e}^{x}}{\sqrt {x}} & \sqrt {x}\, {\mathrm e}^{x} \\ -\frac {{\mathrm e}^{x}}{2 x^{{3}/{2}}}+\frac {{\mathrm e}^{x}}{\sqrt {x}} & \frac {{\mathrm e}^{x}}{2 \sqrt {x}}+\sqrt {x}\, {\mathrm e}^{x} \end {vmatrix} \]

Therefore

\[ W = \left (\frac {{\mathrm e}^{x}}{\sqrt {x}}\right )\left (\frac {{\mathrm e}^{x}}{2 \sqrt {x}}+\sqrt {x}\, {\mathrm e}^{x}\right ) - \left (\sqrt {x}\, {\mathrm e}^{x}\right )\left (-\frac {{\mathrm e}^{x}}{2 x^{{3}/{2}}}+\frac {{\mathrm e}^{x}}{\sqrt {x}}\right ) \]

Which simplifies to

\[ W = \frac {{\mathrm e}^{2 x}}{x} \]

Which simplifies to

\[ W = \frac {{\mathrm e}^{2 x}}{x} \]

Therefore Eq. (2) becomes

\[ u_1 = -\int \frac {4 x \,{\mathrm e}^{2 x}}{4 x \,{\mathrm e}^{2 x}}\,dx \]

Which simplifies to

\[ u_1 = - \int 1d x \]

Hence

\[ u_1 = -x \]

And Eq. (3) becomes

\[ u_2 = \int \frac {4 \,{\mathrm e}^{2 x}}{4 x \,{\mathrm e}^{2 x}}\,dx \]

Which simplifies to

\[ u_2 = \int \frac {1}{x}d x \]

Hence

\[ u_2 = \ln \left (x \right ) \]

Therefore the particular solution, from equation (1) is

\[ y_p(x) = -\sqrt {x}\, {\mathrm e}^{x}+\sqrt {x}\, {\mathrm e}^{x} \ln \left (x \right ) \]

Which simplifies to

\[ y_p(x) = \sqrt {x}\, {\mathrm e}^{x} \left (-1+\ln \left (x \right )\right ) \]

Therefore the general solution is

\begin{align*} y &= y_h + y_p \\ &= \left (\frac {c_1 \,{\mathrm e}^{x}}{\sqrt {x}}+c_2 \sqrt {x}\, {\mathrm e}^{x}\right ) + \left (\sqrt {x}\, {\mathrm e}^{x} \left (-1+\ln \left (x \right )\right )\right ) \\ \end{align*}

Will add steps showing solving for IC soon.

5.5.4 Solved as second order ode adjoint method

Time used: 0.287 (sec)

In normal form the ode

\begin{align*} 4 x^{2} y^{\prime \prime }+\left (-8 x^{2}+4 x \right ) y^{\prime }+\left (4 x^{2}-4 x -1\right ) y = 4 \sqrt {x}\, {\mathrm e}^{x} \tag {1} \end{align*}

Becomes

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

Where

\begin{align*} p \left (x \right )&=\frac {-2 x +1}{x}\\ q \left (x \right )&=\frac {4 x^{2}-4 x -1}{4 x^{2}}\\ r \left (x \right )&=\frac {{\mathrm e}^{x}}{x^{{3}/{2}}} \end{align*}

The Lagrange adjoint ode is given by

\begin{align*} \xi ^{''}-(\xi \, p)'+\xi q &= 0\\ \xi ^{''}-\left (\frac {\left (-2 x +1\right ) \xi \left (x \right )}{x}\right )' + \left (\frac {\left (4 x^{2}-4 x -1\right ) \xi \left (x \right )}{4 x^{2}}\right ) &= 0\\ \frac {\xi ^{\prime \prime }\left (x \right ) x^{2}+\left (2 x^{2}-x \right ) \xi ^{\prime }\left (x \right )+\xi \left (x \right ) \left (-x +\frac {3}{4}+x^{2}\right )}{x^{2}}&= 0 \end{align*}

Which is solved for \(\xi (x)\). In normal form the given ode is written as

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

Where

\begin{align*} p \left (x \right )&=2-\frac {1}{x}\\ q \left (x \right )&=-\frac {1}{x}+\frac {3}{4 x^{2}}+1 \end{align*}

Calculating the Liouville ode invariant \(Q\) given by

\begin{align*} Q &= q - \frac {p'}{2}- \frac {p^2}{4} \\ &= -\frac {1}{x}+\frac {3}{4 x^{2}}+1 - \frac {\left (2-\frac {1}{x}\right )'}{2}- \frac {\left (2-\frac {1}{x}\right )^2}{4} \\ &= -\frac {1}{x}+\frac {3}{4 x^{2}}+1 - \frac {\left (\frac {1}{x^{2}}\right )}{2}- \frac {\left (\left (2-\frac {1}{x}\right )^{2}\right )}{4} \\ &= -\frac {1}{x}+\frac {3}{4 x^{2}}+1 - \left (\frac {1}{2 x^{2}}\right )-\frac {\left (2-\frac {1}{x}\right )^{2}}{4}\\ &= 0 \end{align*}

Since the Liouville ode invariant does not depend on the independent variable \(x\) then the transformation

\begin{align*} \xi = v \left (x \right ) z \left (x \right )\tag {3} \end{align*}

is used to change the original ode to a constant coefficients ode in \(v\). In (3) the term \(z \left (x \right )\) is given by

\begin{align*} z \left (x \right )&={\mathrm e}^{-\left (\int \frac {p \left (x \right )}{2}d x \right )}\\ &= e^{-\int \frac {2-\frac {1}{x}}{2} }\\ &= \sqrt {x}\, {\mathrm e}^{-x}\tag {5} \end{align*}

Hence (3) becomes

\begin{align*} \xi = v \left (x \right ) \sqrt {x}\, {\mathrm e}^{-x}\tag {4} \end{align*}

Applying this change of variable to the original ode results in

\begin{align*} v^{\prime \prime }\left (x \right ) \sqrt {x}\, {\mathrm e}^{-x} = 0 \end{align*}

Which is now solved for \(v \left (x \right )\).

The above ode can be simplified to

\begin{align*} v^{\prime \prime }\left (x \right ) = 0 \end{align*}

Integrating twice gives the solution

\[ v \left (x \right )= c_1 x + c_2 \]

Will add steps showing solving for IC soon.

Now that \(v \left (x \right )\) is known, then

\begin{align*} \xi &= v \left (x \right ) z \left (x \right )\\ &= \left (c_1 x +c_2\right ) \left (z \left (x \right )\right )\tag {7} \end{align*}

But from (5)

\begin{align*} z \left (x \right )&= \sqrt {x}\, {\mathrm e}^{-x} \end{align*}

Hence (7) becomes

\begin{align*} \xi = \left (c_1 x +c_2 \right ) \sqrt {x}\, {\mathrm e}^{-x} \end{align*}

Will add steps showing solving for IC soon.

The original ode (2) now reduces to first order ode

\begin{align*} \xi \left (x \right ) y^{\prime }-y \xi ^{\prime }\left (x \right )+\xi \left (x \right ) p \left (x \right ) y&=\int \xi \left (x \right ) r \left (x \right )d x\\ y^{\prime }+y \left (p \left (x \right )-\frac {\xi ^{\prime }\left (x \right )}{\xi \left (x \right )}\right )&=\frac {\int \xi \left (x \right ) r \left (x \right )d x}{\xi \left (x \right )}\\ y^{\prime }+y \left (\frac {-2 x +1}{x}-\frac {\left (c_1 \sqrt {x}\, {\mathrm e}^{-x}+\frac {\left (c_1 x +c_2 \right ) {\mathrm e}^{-x}}{2 \sqrt {x}}-\left (c_1 x +c_2 \right ) \sqrt {x}\, {\mathrm e}^{-x}\right ) {\mathrm e}^{x}}{\left (c_1 x +c_2 \right ) \sqrt {x}}\right )&=\frac {{\mathrm e}^{x} \left (c_1 x +c_2 \ln \left (x \right )\right )}{\left (c_1 x +c_2 \right ) \sqrt {x}} \end{align*}

Which is now a first order ode. This is now solved for \(y\). In canonical form a linear first order is

\begin{align*} y^{\prime } + q(x)y &= p(x) \end{align*}

Comparing the above to the given ode shows that

\begin{align*} q(x) &=-\frac {\left (2 \,{\mathrm e}^{-x} c_1 \,x^{3}+{\mathrm e}^{-x} c_1 \,x^{2}+2 \,{\mathrm e}^{-x} c_2 \,x^{2}-{\mathrm e}^{-x} c_2 x \right ) {\mathrm e}^{x}}{2 x^{2} \left (c_1 x +c_2 \right )}\\ p(x) &=\frac {\left (2 x^{{5}/{2}} c_1 +2 x^{{3}/{2}} \ln \left (x \right ) c_2 \right ) {\mathrm e}^{x}}{2 x^{2} \left (c_1 x +c_2 \right )} \end{align*}

The integrating factor \(\mu \) is

\begin{align*} \mu &= e^{\int {q\,dx}}\\ &= {\mathrm e}^{\int -\frac {\left (2 \,{\mathrm e}^{-x} c_1 \,x^{3}+{\mathrm e}^{-x} c_1 \,x^{2}+2 \,{\mathrm e}^{-x} c_2 \,x^{2}-{\mathrm e}^{-x} c_2 x \right ) {\mathrm e}^{x}}{2 x^{2} \left (c_1 x +c_2 \right )}d x}\\ &= \frac {\sqrt {x}\, {\mathrm e}^{-x}}{c_1 x +c_2} \end{align*}

The ode becomes

\begin{align*} \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \mu p \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}}\left ( \mu y\right ) &= \left (\mu \right ) \left (\frac {\left (2 x^{{5}/{2}} c_1 +2 x^{{3}/{2}} \ln \left (x \right ) c_2 \right ) {\mathrm e}^{x}}{2 x^{2} \left (c_1 x +c_2 \right )}\right ) \\ \frac {\mathop {\mathrm {d}}}{ \mathop {\mathrm {d}x}} \left (\frac {y \sqrt {x}\, {\mathrm e}^{-x}}{c_1 x +c_2}\right ) &= \left (\frac {\sqrt {x}\, {\mathrm e}^{-x}}{c_1 x +c_2}\right ) \left (\frac {\left (2 x^{{5}/{2}} c_1 +2 x^{{3}/{2}} \ln \left (x \right ) c_2 \right ) {\mathrm e}^{x}}{2 x^{2} \left (c_1 x +c_2 \right )}\right ) \\ \mathrm {d} \left (\frac {y \sqrt {x}\, {\mathrm e}^{-x}}{c_1 x +c_2}\right ) &= \left (\frac {2 x^{{5}/{2}} c_1 +2 x^{{3}/{2}} \ln \left (x \right ) c_2}{2 x^{{3}/{2}} \left (c_1 x +c_2 \right )^{2}}\right )\, \mathrm {d} x \\ \end{align*}

Integrating gives

\begin{align*} \frac {y \sqrt {x}\, {\mathrm e}^{-x}}{c_1 x +c_2}&= \int {\frac {2 x^{{5}/{2}} c_1 +2 x^{{3}/{2}} \ln \left (x \right ) c_2}{2 x^{{3}/{2}} \left (c_1 x +c_2 \right )^{2}} \,dx} \\ &=\frac {c_2}{c_1 \left (c_1 x +c_2 \right )}+\frac {\ln \left (x \right ) x}{c_1 x +c_2} + c_3 \end{align*}

Dividing throughout by the integrating factor \(\frac {\sqrt {x}\, {\mathrm e}^{-x}}{c_1 x +c_2}\) gives the final solution

\[ y = \frac {\left (c_1^{2} c_3 x +\ln \left (x \right ) x c_1 +c_1 c_2 c_3 +c_2 \right ) {\mathrm e}^{x}}{c_1 \sqrt {x}} \]

Hence, the solution found using Lagrange adjoint equation method is

\begin{align*} y &= \frac {\left (c_1^{2} c_3 x +\ln \left (x \right ) x c_1 +c_1 c_2 c_3 +c_2 \right ) {\mathrm e}^{x}}{c_1 \sqrt {x}} \\ \end{align*}

Will add steps showing solving for IC soon.

5.5.5 Maple step by step solution

5.5.6 Maple trace
Methods for second order ODEs:
 
5.5.7 Maple dsolve solution

Solving time : 0.010 (sec)
Leaf size : 21

dsolve(4*x^2*diff(diff(y(x),x),x)+(-8*x^2+4*x)*diff(y(x),x)+(4*x^2-4*x-1)*y(x) = 4*x^(1/2)*exp(x), 
       y(x),singsol=all)
 
\[ y = \frac {\left (x \ln \left (x \right )+\left (-1+c_1 \right ) x +c_2 \right ) {\mathrm e}^{x}}{\sqrt {x}} \]
5.5.8 Mathematica DSolve solution

Solving time : 0.046 (sec)
Leaf size : 27

DSolve[{4*x^2*D[y[x],{x,2}]+(-8*x^2+4*x)*D[y[x],x]+(4*x^2-4*x-1)*y[x] == 4*x^(1/2)*Exp[x],{}}, 
       y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {e^x (x \log (x)+(-1+c_2) x+c_1)}{\sqrt {x}} \]