1.186 problem 187

1.186.1 Solved using Lie symmetry for first order ode
1.186.2 Solved as first order ode of type Riccati
1.186.3 Maple step by step solution
1.186.4 Maple trace
1.186.5 Maple dsolve solution
1.186.6 Mathematica DSolve solution

Internal problem ID [9168]
Book : Differential Gleichungen, E. Kamke, 3rd ed. Chelsea Pub. NY, 1948
Section : Chapter 1, linear first order
Problem number : 187
Date solved : Thursday, October 17, 2024 at 01:27:34 PM
CAS classification : [[_homogeneous, `class G`], _Riccati]

Solve

\begin{align*} x^{n} y^{\prime }-a y^{2}-b \,x^{2 n -2}&=0 \end{align*}

1.186.1 Solved using Lie symmetry for first order ode

Time used: 2.099 (sec)

Writing the ode as

\begin{align*} y^{\prime }&=\left (a \,y^{2}+b \,x^{2 n -2}\right ) x^{-n}\\ y^{\prime }&= \omega \left ( x,y\right ) \end{align*}

The condition of Lie symmetry is the linearized PDE given by

\begin{align*} \eta _{x}+\omega \left ( \eta _{y}-\xi _{x}\right ) -\omega ^{2}\xi _{y}-\omega _{x}\xi -\omega _{y}\eta =0\tag {A} \end{align*}

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 &= x a_{2}+y a_{3}+a_{1} \\ \tag{2E} \eta &= x b_{2}+y b_{3}+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}+\left (a \,y^{2}+b \,x^{2 n -2}\right ) x^{-n} \left (b_{3}-a_{2}\right )-\left (a \,y^{2}+b \,x^{2 n -2}\right )^{2} x^{-2 n} a_{3}-\left (\frac {b \,x^{2 n -2} \left (2 n -2\right ) x^{-n}}{x}-\frac {\left (a \,y^{2}+b \,x^{2 n -2}\right ) x^{-n} n}{x}\right ) \left (x a_{2}+y a_{3}+a_{1}\right )-2 a y \,x^{-n} \left (x b_{2}+y b_{3}+b_{1}\right ) = 0 \end{equation}

Putting the above in normal form gives

\[ \frac {\left (-a^{2} x \,y^{4} a_{3}+x^{n} a n x \,y^{2} a_{2}+x^{n} a n \,y^{3} a_{3}-2 x^{2 n -2} a b x \,y^{2} a_{3}-x^{n} x^{2 n -2} b n x a_{2}-x^{n} x^{2 n -2} b n y a_{3}+x^{n} a n \,y^{2} a_{1}-2 x^{n} a \,x^{2} y b_{2}-x^{n} a x \,y^{2} a_{2}-x^{n} a x \,y^{2} b_{3}-x^{4 n -4} b^{2} x a_{3}-x^{n} x^{2 n -2} b n a_{1}+x^{n} x^{2 n -2} b x a_{2}+x^{n} x^{2 n -2} b x b_{3}+2 x^{n} x^{2 n -2} b y a_{3}-2 x^{n} a x y b_{1}+b_{2} x^{2 n} x +2 x^{n} x^{2 n -2} b a_{1}\right ) x^{-2 n}}{x} = 0 \]

Setting the numerator to zero gives

\begin{equation} \tag{6E} -a^{2} x \,y^{4} a_{3}+x^{n} a n x \,y^{2} a_{2}+x^{n} a n \,y^{3} a_{3}-2 x^{2 n -2} a b x \,y^{2} a_{3}-x^{n} x^{2 n -2} b n x a_{2}-x^{n} x^{2 n -2} b n y a_{3}+x^{n} a n \,y^{2} a_{1}-2 x^{n} a \,x^{2} y b_{2}-x^{n} a x \,y^{2} a_{2}-x^{n} a x \,y^{2} b_{3}-x^{4 n -4} b^{2} x a_{3}-x^{n} x^{2 n -2} b n a_{1}+x^{n} x^{2 n -2} b x a_{2}+x^{n} x^{2 n -2} b x b_{3}+2 x^{n} x^{2 n -2} b y a_{3}-2 x^{n} a x y b_{1}+b_{2} x^{2 n} x +2 x^{n} x^{2 n -2} b a_{1} = 0 \end{equation}

Simplifying the above gives

\begin{equation} \tag{6E} -\frac {a^{2} x^{4} y^{4} a_{3}-x^{n} a n \,x^{4} y^{2} a_{2}-x^{n} a n \,y^{3} a_{3} x^{3}+2 x^{2 n} a b \,y^{2} a_{3} x^{2}-x^{n} a n \,y^{2} a_{1} x^{3}+2 x^{n} a \,x^{5} y b_{2}+x^{n} a \,x^{4} y^{2} a_{2}+x^{n} a \,x^{4} y^{2} b_{3}+x^{3 n} b n a_{2} x^{2}+x^{3 n} b n y a_{3} x +2 x^{n} a \,x^{4} y b_{1}+x^{4 n} b^{2} a_{3}+x^{3 n} b n a_{1} x -x^{3 n} b a_{2} x^{2}-x^{3 n} b b_{3} x^{2}-2 x^{3 n} b y a_{3} x -b_{2} x^{2 n} x^{4}-2 x^{3 n} b a_{1} x}{x^{3}} = 0 \end{equation}

Looking at the above PDE shows the following are all the terms with \(\{x, y\}\) in them.

\[ \{x, y, x^{n}\} \]

The following substitution is now made to be able to collect on all terms with \(\{x, y\}\) in them

\[ \{x = v_{1}, y = v_{2}, x^{n} = v_{3}\} \]

The above PDE (6E) now becomes

\begin{equation} \tag{7E} -\frac {a^{2} v_{1}^{4} v_{2}^{4} a_{3}-v_{3} a n v_{1}^{4} v_{2}^{2} a_{2}-v_{3} a n v_{2}^{3} a_{3} v_{1}^{3}+2 v_{3}^{2} a b v_{2}^{2} a_{3} v_{1}^{2}-v_{3} a n v_{2}^{2} a_{1} v_{1}^{3}+v_{3} a v_{1}^{4} v_{2}^{2} a_{2}+2 v_{3} a v_{1}^{5} v_{2} b_{2}+v_{3} a v_{1}^{4} v_{2}^{2} b_{3}+2 v_{3} a v_{1}^{4} v_{2} b_{1}+v_{3}^{3} b n a_{2} v_{1}^{2}+v_{3}^{3} b n v_{2} a_{3} v_{1}+v_{3}^{4} b^{2} a_{3}+v_{3}^{3} b n a_{1} v_{1}-v_{3}^{3} b a_{2} v_{1}^{2}-2 v_{3}^{3} b v_{2} a_{3} v_{1}-v_{3}^{3} b b_{3} v_{1}^{2}-b_{2} v_{3}^{2} v_{1}^{4}-2 v_{3}^{3} b a_{1} v_{1}}{v_{1}^{3}} = 0 \end{equation}

Collecting the above on the terms \(v_i\) introduced, and these are

\[ \{v_{1}, v_{2}, v_{3}\} \]

Equation (7E) now becomes

\begin{equation} \tag{8E} -2 a b_{2} v_{2} v_{3} v_{1}^{2}-a^{2} a_{3} v_{2}^{4} v_{1}+\left (a n a_{2}-a a_{2}-a b_{3}\right ) v_{2}^{2} v_{3} v_{1}-2 a b_{1} v_{2} v_{3} v_{1}+b_{2} v_{3}^{2} v_{1}+a n a_{3} v_{2}^{3} v_{3}+a n a_{1} v_{2}^{2} v_{3}-\frac {2 a b a_{3} v_{2}^{2} v_{3}^{2}}{v_{1}}+\frac {\left (-b n a_{2}+b a_{2}+b b_{3}\right ) v_{3}^{3}}{v_{1}}+\frac {\left (-b n a_{3}+2 b a_{3}\right ) v_{2} v_{3}^{3}}{v_{1}^{2}}+\frac {\left (-b n a_{1}+2 b a_{1}\right ) v_{3}^{3}}{v_{1}^{2}}-\frac {v_{3}^{4} b^{2} a_{3}}{v_{1}^{3}} = 0 \end{equation}

Setting each coefficients in (8E) to zero gives the following equations to solve

\begin{align*} b_{2}&=0\\ a n a_{1}&=0\\ a n a_{3}&=0\\ -2 a b_{1}&=0\\ -2 a b_{2}&=0\\ -a^{2} a_{3}&=0\\ -b^{2} a_{3}&=0\\ -2 a b a_{3}&=0\\ -b n a_{1}+2 b a_{1}&=0\\ -b n a_{3}+2 b a_{3}&=0\\ a n a_{2}-a a_{2}-a b_{3}&=0\\ -b n a_{2}+b a_{2}+b b_{3}&=0 \end{align*}

Solving the above equations for the unknowns gives

\begin{align*} a_{1}&=0\\ a_{2}&=a_{2}\\ a_{3}&=0\\ b_{1}&=0\\ b_{2}&=0\\ b_{3}&=\left (n -1\right ) a_{2} \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 &= x \\ \eta &= y \left (n -1\right ) \\ \end{align*}

Shifting is now applied to make \(\xi =0\) in order to simplify the rest of the computation

\begin{align*} \eta &= \eta - \omega \left (x,y\right ) \xi \\ &= y \left (n -1\right ) - \left (\left (a \,y^{2}+b \,x^{2 n -2}\right ) x^{-n}\right ) \left (x\right ) \\ &= \left (-x a \,y^{2}+y \,x^{n} n -\frac {b \,x^{2 n}}{x}-y \,x^{n}\right ) x^{-n}\\ \xi &= 0 \end{align*}

The next step is to determine the canonical coordinates \(R,S\). The canonical coordinates map \(\left ( x,y\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 y}{\eta } = dS \tag {1} \end{align*}

The above comes from the requirements that \(\left ( \xi \frac {\partial }{\partial x} + \eta \frac {\partial }{\partial y}\right ) S(x,y) = 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}{\left (-x a \,y^{2}+y \,x^{n} n -\frac {b \,x^{2 n}}{x}-y \,x^{n}\right ) x^{-n}}} dy \end{align*}

Which results in

\begin{align*} S&= -\frac {2 x^{n} x \arctan \left (\frac {2 a \,x^{2} y -n \,x^{1+n}+x^{1+n}}{\sqrt {4 b \,x^{2 n} a \,x^{2}-x^{2+2 n} n^{2}+2 x^{2+2 n} n -x^{2+2 n}}}\right )}{\sqrt {4 b \,x^{2 n} a \,x^{2}-x^{2+2 n} n^{2}+2 x^{2+2 n} n -x^{2+2 n}}} \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,y) S_{y} }{ R_{x} + \omega (x,y) R_{y} }\tag {2} \end{align*}

Where in the above \(R_{x},R_{y},S_{x},S_{y}\) are all partial derivatives and \(\omega (x,y)\) is the right hand side of the original ode given by

\begin{align*} \omega (x,y) &= \left (a \,y^{2}+b \,x^{2 n -2}\right ) x^{-n} \end{align*}

Evaluating all the partial derivatives gives

\begin{align*} R_{x} &= 1\\ R_{y} &= 0\\ S_{x} &= \frac {y \left (n -1\right ) x^{-n}}{-y \left (n -1\right ) x^{-n +1}+x^{-2 n +2} a \,y^{2}+b}\\ S_{y} &= -\frac {x^{-n +1}}{-y \left (n -1\right ) x^{-n +1}+x^{-2 n +2} a \,y^{2}+b} \end{align*}

Substituting all the above in (2) and simplifying gives the ode in canonical coordinates.

\begin{align*} \frac {dS}{dR} &= \frac {y \left (n -1\right ) x^{-n}}{-y \left (n -1\right ) x^{-n +1}+x^{-2 n +2} a \,y^{2}+b}-\frac {x^{2 n} \left (a \,x^{-2 n +1} y^{2} x +b \right )}{\left (-y \left (n -1\right ) x^{1+n}+a \,y^{2} x^{2}+b \,x^{2 n}\right ) x}\tag {2A} \end{align*}

We now need to express the RHS as function of \(R\) only. This is done by solving for \(x,y\) in terms of \(R,S\) from the result obtained earlier and simplifying. This gives

\begin{align*} \frac {dS}{dR} &= -\frac {1}{R} \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\).

Since the ode has the form \(\frac {d}{d R}S \left (R \right )=f(R)\), then we only need to integrate \(f(R)\).

\begin{align*} \int {dS} &= \int {-\frac {1}{R}\, dR}\\ S \left (R \right ) &= -\ln \left (R \right ) + c_2 \end{align*}

To complete the solution, we just need to transform the above back to \(x,y\) coordinates. This results in

\begin{align*} -\frac {2 \arctan \left (\frac {2 a \,x^{-n +1} y-n +1}{\sqrt {4 a b -n^{2}+2 n -1}}\right )}{\sqrt {4 a b -n^{2}+2 n -1}} = -\ln \left (x \right )+c_2 \end{align*}

Which gives

\begin{align*} y = -\frac {\left (\tan \left (-\frac {\ln \left (x \right ) \sqrt {4 a b -n^{2}+2 n -1}}{2}+\frac {c_2 \sqrt {4 a b -n^{2}+2 n -1}}{2}\right ) \sqrt {4 a b -n^{2}+2 n -1}-n +1\right ) x^{n -1}}{2 a} \end{align*}

1.186.2 Solved as first order ode of type Riccati

Time used: 0.691 (sec)

In canonical form the ODE is

\begin{align*} y' &= F(x,y)\\ &= \left (a \,y^{2}+b \,x^{2 n -2}\right ) x^{-n} \end{align*}

This is a Riccati ODE. Comparing the ODE to solve

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

With Riccati ODE standard form

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

Shows that \(f_0(x)=b \,x^{2 n -2} x^{-n}\), \(f_1(x)=0\) and \(f_2(x)=a \,x^{-n}\). Let

\begin{align*} y &= \frac {-u'}{f_2 u} \\ &= \frac {-u'}{u a \,x^{-n}} \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 {a \,x^{-n} n}{x}\\ f_1 f_2 &=0\\ f_2^2 f_0 &=a^{2} x^{-3 n} b \,x^{2 n -2} \end{align*}

Substituting the above terms back in equation (2) gives

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

In normal form the ode

\begin{align*} a \,x^{-n} \left (\frac {d^{2}u}{d x^{2}}\right )+\frac {a \,x^{-n} n \left (\frac {d u}{d x}\right )}{x}+a^{2} x^{-3 n} b \,x^{2 n -2} 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 {n}{x}\\ q \left (x \right )&=\frac {a b}{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 {n}{x}d x \right )}d x\\ &= \int e^{-n \ln \left (x \right )} \,dx\\ &= \int x^{-n}d x\\ &= -\frac {x^{-n +1}}{n -1}\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 {\frac {a b}{x^{2}}}{x^{-2 n}}\\ &= a b \,x^{2 n -2}\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 )+a b \,x^{2 n -2} u \left (\tau \right )&=0 \\ \end{align*}

But in terms of \(\tau \)

\begin{align*} a b \,x^{2 n -2}&=\frac {a b}{\left (n -1\right )^{2} \tau ^{2}} \end{align*}

Hence the above ode becomes

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

The above ode is now solved for \(u \left (\tau \right )\). This is Euler second order ODE. Let the solution be \(u \left (\tau \right ) = \tau ^r\), then \(u'=r \tau ^{r-1}\) and \(u''=r(r-1) \tau ^{r-2}\). Substituting these back into the given ODE gives

\[ \left (n -1\right )^{2} \tau ^{2}(r(r-1))\tau ^{r-2}+0 r \tau ^{r-1}+a b \,\tau ^{r} = 0 \]

Simplifying gives

\[ \left (n -1\right )^{2} r \left (r -1\right )\tau ^{r}+0\,\tau ^{r}+a b \,\tau ^{r} = 0 \]

Since \(\tau ^{r}\neq 0\) then dividing throughout by \(\tau ^{r}\) gives

\[ \left (n -1\right )^{2} r \left (r -1\right )+0+a b = 0 \]

Or

\[ \left (n^{2}-2 n +1\right ) r^{2}+\left (-n^{2}+2 n -1\right ) r +a b = 0 \tag {1} \]

Equation (1) is the characteristic equation. Its roots determine the form of the general solution. Using the quadratic equation the roots are

\begin{align*} r_1 &= -\frac {-n +1+\sqrt {-4 a b +n^{2}-2 n +1}}{2 \left (n -1\right )}\\ r_2 &= \frac {n -1+\sqrt {-4 a b +n^{2}-2 n +1}}{2 n -2} \end{align*}

Since the roots are real and distinct, then the general solution is

\[ u \left (\tau \right )= c_1 u_1 + c_2 u_2 \]

Where \(u_1 = \tau ^{r_1}\) and \(u_2 = \tau ^{r_2} \). Hence

\[ u \left (\tau \right ) = c_1 \,\tau ^{-\frac {-n +1+\sqrt {-4 a b +n^{2}-2 n +1}}{2 \left (n -1\right )}}+c_2 \,\tau ^{\frac {n -1+\sqrt {-4 a b +n^{2}-2 n +1}}{2 n -2}} \]

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 \left (-\frac {x^{-n +1}}{n -1}\right )^{-\frac {-n +1+\sqrt {-4 a b +n^{2}-2 n +1}}{2 \left (n -1\right )}}+c_2 \left (-\frac {x^{-n +1}}{n -1}\right )^{\frac {n -1+\sqrt {-4 a b +n^{2}-2 n +1}}{2 n -2}} \]

Will add steps showing solving for IC soon.

Taking derivative gives

\[ u^{\prime }\left (x \right ) = -\frac {c_1 \left (-\frac {x^{-n +1}}{n -1}\right )^{-\frac {-n +1+\sqrt {-4 a b +n^{2}-2 n +1}}{2 \left (n -1\right )}} \left (-n +1+\sqrt {-4 a b +n^{2}-2 n +1}\right ) \left (-n +1\right )}{2 \left (n -1\right ) x}+\frac {c_2 \left (-\frac {x^{-n +1}}{n -1}\right )^{\frac {n -1+\sqrt {-4 a b +n^{2}-2 n +1}}{2 n -2}} \left (n -1+\sqrt {-4 a b +n^{2}-2 n +1}\right ) \left (-n +1\right )}{2 \left (n -1\right ) x} \]

Doing change of constants, the solution becomes

\[ y = -\frac {\left (-\frac {c_3 \left (-\frac {x^{-n +1}}{n -1}\right )^{-\frac {-n +1+\sqrt {-4 a b +n^{2}-2 n +1}}{2 \left (n -1\right )}} \left (-n +1+\sqrt {-4 a b +n^{2}-2 n +1}\right ) \left (-n +1\right )}{2 \left (n -1\right ) x}+\frac {\left (-\frac {x^{-n +1}}{n -1}\right )^{\frac {n -1+\sqrt {-4 a b +n^{2}-2 n +1}}{2 n -2}} \left (n -1+\sqrt {-4 a b +n^{2}-2 n +1}\right ) \left (-n +1\right )}{2 \left (n -1\right ) x}\right ) x^{n}}{a \left (c_3 \left (-\frac {x^{-n +1}}{n -1}\right )^{-\frac {-n +1+\sqrt {-4 a b +n^{2}-2 n +1}}{2 \left (n -1\right )}}+\left (-\frac {x^{-n +1}}{n -1}\right )^{\frac {n -1+\sqrt {-4 a b +n^{2}-2 n +1}}{2 n -2}}\right )} \]

1.186.3 Maple step by step solution
\[ \begin {array}{lll} & {} & \textrm {Let's solve}\hspace {3pt} \\ {} & {} & x^{n} \left (\frac {d}{d x}y \left (x \right )\right )-a y \left (x \right )^{2}-b \,x^{2 n -2}=0 \\ \bullet & {} & \textrm {Highest derivative means the order of the ODE is}\hspace {3pt} 1 \\ {} & {} & \frac {d}{d x}y \left (x \right ) \\ \bullet & {} & \textrm {Solve for the highest derivative}\hspace {3pt} \\ {} & {} & \frac {d}{d x}y \left (x \right )=\frac {a y \left (x \right )^{2}+b \,x^{2 n -2}}{x^{n}} \end {array} \]

1.186.4 Maple trace
`Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying 1st order linear 
trying Bernoulli 
trying separable 
trying inverse linear 
trying homogeneous types: 
trying homogeneous G 
<- homogeneous successful`
 
1.186.5 Maple dsolve solution

Solving time : 0.021 (sec)
Leaf size : 59

dsolve(x^n*diff(y(x),x)-a*y(x)^2-b*x^(2*n-2) = 0, 
       y(x),singsol=all)
 
\[ y = \frac {x^{n -1} \left (n -1+\tan \left (\frac {\sqrt {4 b a -n^{2}+2 n -1}\, \left (\ln \left (x \right )-c_{1} \right )}{2}\right ) \sqrt {4 b a -n^{2}+2 n -1}\right )}{2 a} \]
1.186.6 Mathematica DSolve solution

Solving time : 0.513 (sec)
Leaf size : 202

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