2.5.5 Problem 5
Internal
problem
ID
[10240]
Book
:
Own
collection
of
miscellaneous
problems
Section
:
section
5.0
Problem
number
:
5
Date
solved
:
Sunday, March 01, 2026 at 07:37:28 AM
CAS
classification
:
[[_2nd_order, _linear, _nonhomogeneous]]
2.5.5.1 second order ode solved by an integrating factor
0.117 (sec)
\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*}
Entering second order ode solved by an integrating factor solverThe 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 {1-2 x}{x}\). Therefore, there is an integrating factor given by \begin{align*} M(x) &= e^{\frac {1}{2} \int p \, dx} \\ &= e^{ \int \frac {1-2 x}{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}
\]
Summary of solutions found
\begin{align*}
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} \\
\end{align*}
2.5.5.2 second order kovacic
0.252 (sec)
\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*}
Entering kovacic solverWriting 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 2.120: 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} \ln \left (x \right )-\sqrt {x}\, {\mathrm e}^{x}
\]
Which simplifies to \[
y_p(x) = {\mathrm e}^{x} \sqrt {x}\, \left (\ln \left (x \right )-1\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 ({\mathrm e}^{x} \sqrt {x}\, \left (\ln \left (x \right )-1\right )\right ) \\
\end{align*}
Summary of solutions found
\begin{align*}
y &= {\mathrm e}^{x} \sqrt {x}\, \left (\ln \left (x \right )-1\right )+\frac {c_1 \,{\mathrm e}^{x}}{\sqrt {x}}+c_2 \sqrt {x}\, {\mathrm e}^{x} \\
\end{align*}
2.5.5.3 ✓ Maple. Time used: 0.007 (sec). Leaf size: 21
ode:=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);
dsolve(ode,y(x), singsol=all);
\[
y = \frac {{\mathrm e}^{x} \left (x \ln \left (x \right )+\left (c_1 -1\right ) x +c_2 \right )}{\sqrt {x}}
\]
Maple trace
Methods for second order ODEs:
--- Trying classification methods ---
trying a quadrature
trying high order exact linear fully integrable
trying differential order: 2; linear nonhomogeneous with symmetry [0,1]
trying a double symmetry of the form [xi=0, eta=F(x)]
-> Try solving first the homogeneous part of the ODE
checking if the LODE has constant coefficients
checking if the LODE is of Euler type
trying a symmetry of the form [xi=0, eta=F(x)]
checking if the LODE is missing y
-> Trying a Liouvillian solution using Kovacics algorithm
A Liouvillian solution exists
Reducible group (found an exponential solution)
<- Kovacics algorithm successful
<- solving first the homogeneous part of the ODE successful
2.5.5.4 ✓ Mathematica. Time used: 0.028 (sec). Leaf size: 27
ode=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];
ic={};
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
\begin{align*} y(x)&\to \frac {e^x (x \log (x)+(-1+c_2) x+c_1)}{\sqrt {x}} \end{align*}
2.5.5.5 ✗ Sympy
from sympy import *
x = symbols("x")
y = Function("y")
ode = Eq(-4*sqrt(x)*exp(x) + 4*x**2*Derivative(y(x), (x, 2)) + (-8*x**2 + 4*x)*Derivative(y(x), x) + (4*x**2 - 4*x - 1)*y(x),0)
ics = {}
dsolve(ode,func=y(x),ics=ics)
NotImplementedError : The given ODE Derivative(y(x), x) - (-sqrt(x)*exp(x) + x**2*y(x) + x**2*Deriva
Python version: 3.12.3 (main, Aug 14 2025, 17:47:21) [GCC 13.3.0]
Sympy version 1.14.0
classify_ode(ode,func=y(x))
('factorable',)