1.36 problem 37

1.36.1 Solved as first order ode of type Riccati
1.36.2 Maple step by step solution
1.36.3 Maple trace
1.36.4 Maple dsolve solution
1.36.5 Mathematica DSolve solution

Internal problem ID [7728]
Book : Own collection of miscellaneous problems
Section : section 1.0
Problem number : 37
Date solved : Monday, October 21, 2024 at 03:59:27 PM
CAS classification : [_rational, _Riccati]

Solve

\begin{align*} x y^{\prime }-2 y+b y^{2}&=c \,x^{4} \end{align*}

1.36.1 Solved as first order ode of type Riccati

Time used: 0.506 (sec)

In canonical form the ODE is

\begin{align*} y' &= F(x,y)\\ &= -\frac {-c \,x^{4}+b \,y^{2}-2 y}{x} \end{align*}

This is a Riccati ODE. Comparing the ODE to solve

\[ y' = c \,x^{3}-\frac {b \,y^{2}}{x}+\frac {2 y}{x} \]

With Riccati ODE standard form

\[ y' = f_0(x)+ f_1(x)y+f_2(x)y^{2} \]

Shows that \(f_0(x)=c \,x^{3}\), \(f_1(x)=\frac {2}{x}\) and \(f_2(x)=-\frac {b}{x}\). Let

\begin{align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{-\frac {u b}{x}} \tag {1} \end{align*}

Using the above substitution in the given ODE results (after some simplification)in a second order ODE to solve for \(u(x)\) which is

\begin{align*} f_2 u''(x) -\left ( f_2' + f_1 f_2 \right ) u'(x) + f_2^2 f_0 u(x) &= 0 \tag {2} \end{align*}

But

\begin{align*} f_2' &=\frac {b}{x^{2}}\\ f_1 f_2 &=-\frac {2 b}{x^{2}}\\ f_2^2 f_0 &=b^{2} x c \end{align*}

Substituting the above terms back in equation (2) gives

\begin{align*} -\frac {b u^{\prime \prime }\left (x \right )}{x}+\frac {b u^{\prime }\left (x \right )}{x^{2}}+b^{2} x c u \left (x \right ) = 0 \end{align*}

In normal form the ode

\begin{align*} -\frac {b \left (\frac {d^{2}u}{d x^{2}}\right )}{x}+\frac {b \left (\frac {d u}{d x}\right )}{x^{2}}+b^{2} x c u&=0 \tag {1} \end{align*}

Becomes

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

Where

\begin{align*} p \left (x \right )&=-\frac {1}{x}\\ q \left (x \right )&=-b c \,x^{2} \end{align*}

Applying change of variables \(\tau = g \left (x \right )\) to (2) gives

\begin{align*} \frac {d^{2}}{d \tau ^{2}}u \left (\tau \right )+p_{1} \left (\frac {d}{d \tau }u \left (\tau \right )\right )+q_{1} u \left (\tau \right )&=0 \tag {3} \end{align*}

Where \(\tau \) is the new independent variable, and

\begin{align*} p_{1} \left (\tau \right ) &=\frac {\frac {d^{2}}{d x^{2}}\tau \left (x \right )+p \left (x \right ) \left (\frac {d}{d x}\tau \left (x \right )\right )}{\left (\frac {d}{d x}\tau \left (x \right )\right )^{2}}\tag {4} \\ q_{1} \left (\tau \right ) &=\frac {q \left (x \right )}{\left (\frac {d}{d x}\tau \left (x \right )\right )^{2}}\tag {5} \end{align*}

Let \(p_{1} = 0\). Eq (4) simplifies to

\begin{align*} \frac {d^{2}}{d x^{2}}\tau \left (x \right )+p \left (x \right ) \left (\frac {d}{d x}\tau \left (x \right )\right )&=0 \end{align*}

This ode is solved resulting in

\begin{align*} \tau &= \int {\mathrm e}^{-\left (\int p \left (x \right )d x \right )}d x\\ &= \int {\mathrm e}^{-\left (\int -\frac {1}{x}d x \right )}d x\\ &= \int e^{\ln \left (x \right )} \,dx\\ &= \int x d x\\ &= \frac {x^{2}}{2}\tag {6} \end{align*}

Using (6) to evaluate \(q_{1}\) from (5) gives

\begin{align*} q_{1} \left (\tau \right ) &= \frac {q \left (x \right )}{\left (\frac {d}{d x}\tau \left (x \right )\right )^{2}}\\ &= \frac {-b c \,x^{2}}{x^{2}}\\ &= -b c\tag {7} \end{align*}

Substituting the above in (3) and noting that now \(p_{1} = 0\) results in

\begin{align*} \frac {d^{2}}{d \tau ^{2}}u \left (\tau \right )+q_{1} u \left (\tau \right )&=0 \\ \frac {d^{2}}{d \tau ^{2}}u \left (\tau \right )-b c u \left (\tau \right )&=0 \end{align*}

The above ode is now solved for \(u \left (\tau \right )\).This is second order with constant coefficients homogeneous ODE. In standard form the ODE is

\[ A u''(\tau ) + B u'(\tau ) + C u(\tau ) = 0 \]

Where in the above \(A=1, B=0, C=-b c\). Let the solution be \(u \left (\tau \right )=e^{\lambda \tau }\). Substituting this into the ODE gives

\[ \lambda ^{2} {\mathrm e}^{\tau \lambda }-b c \,{\mathrm e}^{\tau \lambda } = 0 \tag {1} \]

Since exponential function is never zero, then dividing Eq(2) throughout by \(e^{\lambda \tau }\) gives

\[ -b c +\lambda ^{2} = 0 \tag {2} \]

Equation (2) is the characteristic equation of the ODE. Its roots determine the general solution form.Using the quadratic formula

\[ \lambda _{1,2} = \frac {-B}{2 A} \pm \frac {1}{2 A} \sqrt {B^2 - 4 A C} \]

Substituting \(A=1, B=0, C=-b c\) into the above gives

\begin{align*} \lambda _{1,2} &= \frac {0}{(2) \left (1\right )} \pm \frac {1}{(2) \left (1\right )} \sqrt {0^2 - (4) \left (1\right )\left (-b c\right )}\\ &= \pm \sqrt {b c} \end{align*}

Hence

\begin{align*} \lambda _1 &= + \sqrt {b c} \\ \lambda _2 &= - \sqrt {b c} \\ \end{align*}

Which simplifies to

\begin{align*} \lambda _1 &= \sqrt {b c} \\ \lambda _2 &= -\sqrt {b c} \\ \end{align*}

Since roots are real and distinct, then the solution is

\begin{align*} u \left (\tau \right ) &= c_1 e^{\lambda _1 \tau } + c_2 e^{\lambda _2 \tau } \\ u \left (\tau \right ) &= c_1 e^{\left (\sqrt {b c}\right )\tau } +c_2 e^{\left (-\sqrt {b c}\right )\tau } \\ \end{align*}

Or

\[ u \left (\tau \right ) =c_1 \,{\mathrm e}^{\tau \sqrt {b c}}+c_2 \,{\mathrm e}^{-\tau \sqrt {b c}} \]

Will add steps showing solving for IC soon.

The above solution is now transformed back to \(u\) using (6) which results in

\[ u = c_1 \,{\mathrm e}^{\frac {x^{2} \sqrt {b c}}{2}}+c_2 \,{\mathrm e}^{-\frac {x^{2} \sqrt {b c}}{2}} \]

Will add steps showing solving for IC soon.

Taking derivative gives

\[ u^{\prime }\left (x \right ) = c_1 x \sqrt {b c}\, {\mathrm e}^{\frac {x^{2} \sqrt {b c}}{2}}-c_2 x \sqrt {b c}\, {\mathrm e}^{-\frac {x^{2} \sqrt {b c}}{2}} \]

Doing change of constants, the solution becomes

\[ y = \frac {\left (c_3 x \sqrt {b c}\, {\mathrm e}^{\frac {x^{2} \sqrt {b c}}{2}}-x \sqrt {b c}\, {\mathrm e}^{-\frac {x^{2} \sqrt {b c}}{2}}\right ) x}{b \left (c_3 \,{\mathrm e}^{\frac {x^{2} \sqrt {b c}}{2}}+{\mathrm e}^{-\frac {x^{2} \sqrt {b c}}{2}}\right )} \]

1.36.2 Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & x y^{\prime }-2 y+b y^{2}=c \,x^{4} \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & y^{\prime } \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & y^{\prime }=\frac {c \,x^{4}-b y^{2}+2 y}{x} \end {array} \]

1.36.3 Maple trace
Methods for first order ODEs:
 
1.36.4 Maple dsolve solution

Solving time : 0.006 (sec)
Leaf size : 29

dsolve(x*diff(y(x),x)-2*y(x)+b*y(x)^2 = c*x^4, 
       y(x),singsol=all)
 
\[ y = \frac {i \tan \left (-\frac {i \sqrt {b}\, x^{2} \sqrt {c}}{2}+c_1 \right ) x^{2} \sqrt {c}}{\sqrt {b}} \]
1.36.5 Mathematica DSolve solution

Solving time : 0.235 (sec)
Leaf size : 153

DSolve[{x*D[y[x],x]-2*y[x]+b*y[x]^2==c*x^4,{}}, 
       y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {\sqrt {c} x^2 \left (-\cos \left (\frac {1}{2} \sqrt {-b} \sqrt {c} x^2\right )+c_1 \sin \left (\frac {1}{2} \sqrt {-b} \sqrt {c} x^2\right )\right )}{\sqrt {-b} \left (\sin \left (\frac {1}{2} \sqrt {-b} \sqrt {c} x^2\right )+c_1 \cos \left (\frac {1}{2} \sqrt {-b} \sqrt {c} x^2\right )\right )} \\ y(x)\to \frac {\sqrt {c} x^2 \tan \left (\frac {1}{2} \sqrt {-b} \sqrt {c} x^2\right )}{\sqrt {-b}} \\ \end{align*}