Internal
problem
ID
[10149]
Book
:
Own
collection
of
miscellaneous
problems
Section
:
section
3.0
Problem
number
:
17
Date
solved
:
Monday, March 09, 2026 at 03:18:47 AM
CAS
classification
:
[[_2nd_order, _with_linear_symmetries]]
0.187 (sec)
Entering second order euler ode solverThis is second order non-homogeneous ODE. In standard form the ODE is
Where \(A=x^{2}, B=x, C=-4, f(x)=x\). Let the solution be
Where \(y_h\) is the solution to the homogeneous ODE
And \(y_p\) is a particular solution to the non-homogeneous ODE
Solving for \(y_h\) from
This is Euler second order ODE. Let the solution be \(y = x^r\), then \(y'=r x^{r-1}\) and \(y''=r(r-1) x^{r-2}\). Substituting these back into the given ODE gives
Simplifying gives
Since \(x^{r}\neq 0\) then dividing throughout by \(x^{r}\) gives
Or
Equation (1) is the characteristic equation. Its roots determine the form of the general solution. Using the quadratic equation the roots are
Since the roots are real and distinct, then the general solution is
Where \(y_1 = x^{r_1}\) and \(y_2 = x^{r_2} \). Hence
Next, we find the particular solution to the ODE
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
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
In the Variation of parameters \(u_1,u_2\) are found using
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
Which gives
Therefore
Which simplifies to
Which simplifies to
Therefore Eq. (2) becomes
Which simplifies to
Hence
And Eq. (3) becomes
Which simplifies to
Hence
Therefore the particular solution, from equation (1) is
Therefore the general solution is
Summary of solutions found
0.237 (sec)
Entering second order change of variable on \(x\) method 2 solverThis is second order non-homogeneous ODE. Let the solution be
Where \(y_h\) is the solution to the homogeneous ODE
And \(y_p\) is a particular solution to the non-homogeneous ODE
\(y_h\) is the solution to
In normal form the ode
Becomes
Where
Applying change of variables \(\tau = g \left (x \right )\) to (2) gives
Where \(\tau \) is the new independent variable, and
Let \(p_{1} = 0\). Eq (4) simplifies to
This ode is solved resulting in
Using (6) to evaluate \(q_{1}\) from (5) gives
Substituting the above in (3) and noting that now \(p_{1} = 0\) results in
The above ode is now solved for \(y \left (\tau \right )\).Entering second order linear constant coefficient ode solver
This is second order with constant coefficients homogeneous ODE. In standard form the ODE is
Where in the above \(A=1, B=0, C=-4\). Let the solution be \(y \left (\tau \right )=e^{\lambda \tau }\). Substituting this into the ODE gives
Since exponential function is never zero, then dividing Eq(2) throughout by \(e^{\lambda \tau }\) gives
Equation (2) is the characteristic equation of the ODE. Its roots determine the general solution form. Using the quadratic formula the roots are
Substituting \(A=1, B=0, C=-4\) into the above gives
Hence
Which simplifies to
Since the roots are distinct, the solution is
Or
The above solution is now transformed back to \(y\) using (6) which results in
Therefore the homogeneous solution \(y_h\) is
The particular solution is now found using the method of undetermined coefficients. Looking at the RHS of the ode, which is
Shows that the corresponding undetermined set of the basis functions (UC_set) for the trial solution is
While the set of the basis functions for the homogeneous solution found earlier is
Since there is no duplication between the basis function in the UC_set and the basis functions of the homogeneous solution, the trial solution is a linear combination of all the basis in the UC_set.
The unknowns \(\{A_{1}, A_{2}\}\) are found by substituting the above trial solution \(y_p\) into the ODE and comparing coefficients. Substituting the trial solution into the ODE and simplifying gives
Solving for the unknowns by comparing coefficients results in
Substituting the above back in the above trial solution \(y_p\), gives the particular solution
Therefore the general solution is
Summary of solutions found
0.313 (sec)
Entering second order change of variable on \(y\) method 2 solverThis is second order non-homogeneous ODE. In standard form the ODE is
Where \(A=x^{2}, B=x, C=-4, f(x)=x\). Let the solution be
Where \(y_h\) is the solution to the homogeneous ODE
And \(y_p\) is a particular solution to the non-homogeneous ODE
Solving for \(y_h\) from
In normal form the ode
Becomes
Where
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\).
Let the coefficient of \(v \left (x \right )\) above be zero. Hence
Substituting the earlier values found for \(p \left (x \right )\) and \(q \left (x \right )\) into (4) gives
Solving (5) for \(n\) gives
Substituting this value in (3) gives
Using the substitution
Then (7) becomes
The above is now solved for \(u \left (x \right )\). Entering first order ode linear solverIn canonical form a linear first order is
Comparing the above to the given ode shows that
The integrating factor \(\mu \) is
The ode becomes
Integrating gives
Dividing throughout by the integrating factor \(x^{5}\) gives the final solution
Now that \(u \left (x \right )\) is known, then
Hence
Now the particular solution to this ODE is found
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
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
In the Variation of parameters \(u_1,u_2\) are found using
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
Which gives
Therefore
Which simplifies to
Which simplifies to
Therefore Eq. (2) becomes
Which simplifies to
Hence
And Eq. (3) becomes
Which simplifies to
Hence
Therefore the particular solution, from equation (1) is
Therefore the general solution is
Summary of solutions found
0.237 (sec)
Entering kovacic solverWriting the ode as
Comparing (1) and (2) shows that
Applying the Liouville transformation on the dependent variable gives
Then (2) becomes
Where \(r\) is given by
Substituting the values of \(A,B,C\) from (3) in the above and simplifying gives
Comparing the above to (5) shows that
Therefore eq. (4) becomes
Equation (7) is now solved. After finding \(z(x)\) then \(y\) is found using the inverse transformation
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 \} \) |
The order of \(r\) at \(\infty \) is the degree of \(t\) minus the degree of \(s\). Therefore
The poles of \(r\) in eq. (7) and the order of each pole are determined by solving for the roots of \(t=4 x^{2}\). There is a pole at \(x=0\) of order \(2\). Since there is no odd order pole larger than \(2\) and the order at \(\infty \) is \(2\) then the necessary conditions for case one are met. Since there is a pole of order \(2\) then necessary conditions for case two are met. Since pole order is not larger than \(2\) and the order at \(\infty \) is \(2\) then the necessary conditions for case three are met. Therefore
Attempting to find a solution using case \(n=1\).
Looking at poles of order 2. The partial fractions decomposition of \(r\) is
For the pole at \(x=0\) let \(b\) be the coefficient of \(\frac {1}{ x^{2}}\) in the partial fractions decomposition of \(r\) given above. Therefore \(b={\frac {15}{4}}\). Hence
Since the order of \(r\) at \(\infty \) is 2 then \([\sqrt r]_\infty =0\). Let \(b\) be the coefficient of \(\frac {1}{x^{2}}\) in the Laurent series expansion of \(r\) at \(\infty \). which can be found by dividing the leading coefficient of \(s\) by the leading coefficient of \(t\) from
Since the \(\text {gcd}(s,t)=1\). This gives \(b={\frac {15}{4}}\). Hence
The following table summarizes the findings so far for poles and for the order of \(r\) at \(\infty \) where \(r\) is
| pole \(c\) location | pole order | \([\sqrt r]_c\) | \(\alpha _c^{+}\) | \(\alpha _c^{-}\) |
| \(0\) | \(2\) | \(0\) | \(\frac {5}{2}\) | \(-{\frac {3}{2}}\) |
| Order of \(r\) at \(\infty \) | \([\sqrt r]_\infty \) | \(\alpha _\infty ^{+}\) | \(\alpha _\infty ^{-}\) |
| \(2\) | \(0\) | \(\frac {5}{2}\) | \(-{\frac {3}{2}}\) |
Now that the all \([\sqrt r]_c\) and its associated \(\alpha _c^{\pm }\) have been determined for all the poles in the set \(\Gamma \) and \([\sqrt r]_\infty \) and its associated \(\alpha _\infty ^{\pm }\) have also been found, the next step is to determine possible non negative integer \(d\) from these using
Where \(s(c)\) is either \(+\) or \(-\) and \(s(\infty )\) is the sign of \(\alpha _\infty ^{\pm }\). This is done by trial over all set of families \(s=(s(c))_{c \in \Gamma \cup {\infty }}\) until such \(d\) is found to work in finding candidate \(\omega \). Trying \(\alpha _\infty ^{-} = -{\frac {3}{2}}\) then
Since \(d\) an integer and \(d \geq 0\) then it can be used to find \(\omega \) using
The above gives
Now that \(\omega \) is determined, the next step is find a corresponding minimal polynomial \(p(x)\) of degree \(d=0\) to solve the ode. The polynomial \(p(x)\) needs to satisfy the equation
Let
Substituting the above in eq. (1A) gives
The equation is satisfied since both sides are zero. Therefore the first solution to the ode \(z'' = r z\) is
The first solution to the original ode in \(y\) is found from
Which simplifies to
The second solution \(y_2\) to the original ode is found using reduction of order
Substituting gives
Therefore the solution is
This is second order nonhomogeneous ODE. Let the solution be
Where \(y_h\) is the solution to the homogeneous ODE
And \(y_p\) is a particular solution to the nonhomogeneous ODE
\(y_h\) is the solution to
The homogeneous solution is found using the Kovacic algorithm which results in
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
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
In the Variation of parameters \(u_1,u_2\) are found using
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
Which gives
Therefore
Which simplifies to
Which simplifies to
Therefore Eq. (2) becomes
Which simplifies to
Hence
And Eq. (3) becomes
Which simplifies to
Hence
Therefore the particular solution, from equation (1) is
Therefore the general solution is
Summary of solutions found
ode:=x^2*diff(diff(y(x),x),x)+x*diff(y(x),x)-4*y(x) = x; dsolve(ode,y(x), singsol=all);
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 <- LODE of Euler type successful <- solving first the homogeneous part of the ODE successful
ode=x^2*D[y[x],{x,2}]+x*D[y[x],x]-4*y[x] == x; ic={}; DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
from sympy import * x = symbols("x") y = Function("y") ode = Eq(x**2*Derivative(y(x), (x, 2)) + x*Derivative(y(x), x) - x - 4*y(x),0) ics = {} dsolve(ode,func=y(x),ics=ics)
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', 'nth_linear_euler_eq_nonhomogeneous_undetermined_coefficients', 'nth_linear_euler_eq_nonhomogeneous_variation_of_parameters', 'nth_linear_euler_eq_nonhomogeneous_variation_of_parameters_Integral')