2.6.5 Problem 8 (eq 68)

Solved using first_order_ode_separable
Solved using first_order_ode_exact
Solved using first_order_ode_LIE
Solved using first_order_ode_riccati
Solved as second order ode using change of variable on x method 2
Solved as second order ode using change of variable on x method 1
Solved as second order Bessel ode
Solved as second order ode using Kovacic algorithm
Maple
Mathematica
Sympy

Internal problem ID [18498]
Book : Elementary Differential Equations. By Thornton C. Fry. D Van Nostrand. NY. First Edition (1929)
Section : Chapter IV. Methods of solution: First order equations. section 33. Problems at page 91
Problem number : 8 (eq 68)
Date solved : Monday, March 31, 2025 at 05:38:16 PM
CAS classification : [_separable]

Solved using first_order_ode_separable

Time used: 0.107 (sec)

Solve

y=x(ay2+b)

The ode

(1)y=x(ay2+b)

is separable as it can be written as

y=x(ay2+b)=f(x)g(y)

Where

f(x)=xg(y)=ay2+b

Integrating gives

1g(y)dy=f(x)dx1ay2+bdy=xdx
arctan(ayba)ba=x22+c1

We now need to find the singular solutions, these are found by finding for what values g(y) is zero, since we had to divide by this above. Solving g(y)=0 or

ay2+b=0

for y gives

y=baay=baa

Now we go over each such singular solution and check if it verifies the ode itself and any initial conditions given. If it does not then the singular solution will not be used.

Therefore the solutions found are

arctan(ayba)ba=x22+c1y=baay=baa

Solving for y gives

y=baay=tan(x2ba2+c1ba)baay=baa

Which simplifies to

y=baay=tan(ba(x22+c1))baay=baa

Summary of solutions found

y=baay=tan(ba(x22+c1))baay=baa
Solved using first_order_ode_exact

Time used: 0.171 (sec)

Solve

y=x(ay2+b)

To solve an ode of the form

(A)M(x,y)+N(x,y)dydx=0

We assume there exists a function ϕ(x,y)=c where c is constant, that satisfies the ode. Taking derivative of ϕ w.r.t. x gives

ddxϕ(x,y)=0

Hence

(B)ϕx+ϕydydx=0

Comparing (A,B) shows that

ϕx=Mϕy=N

But since 2ϕxy=2ϕyx then for the above to be valid, we require that

My=Nx

If the above condition is satisfied, then the original ode is called exact. We still need to determine ϕ(x,y) but at least we know now that we can do that since the condition 2ϕxy=2ϕyx is satisfied. If this condition is not satisfied then this method will not work and we have to now look for an integrating factor to force this condition, which might or might not exist. The first step is to write the ODE in standard form to check for exactness, which is

(1A)M(x,y)dx+N(x,y)dy=0

Therefore

dy=(x(ay2+b))dx(2A)(x(ay2+b))dx+dy=0

Comparing (1A) and (2A) shows that

M(x,y)=x(ay2+b)N(x,y)=1

The next step is to determine if the ODE is is exact or not. The ODE is exact when the following condition is satisfied

My=Nx

Using result found above gives

My=y(x(ay2+b))=2xay

And

Nx=x(1)=0

Since MyNx, then the ODE is not exact. Since the ODE is not exact, we will try to find an integrating factor to make it exact. Let

A=1N(MyNx)=1((2xay)(0))=2xay

Since A depends on y, it can not be used to obtain an integrating factor. We will now try a second method to find an integrating factor. Let

B=1M(NxMy)=1x(ay2+b)((0)(2xay))=2ayay2+b

Since B does not depend on x, it can be used to obtain an integrating factor. Let the integrating factor be μ. Then

μ=eBdy=e2ayay2+bdy

The result of integrating gives

μ=eln(ay2+b)=1ay2+b

M and N are now multiplied by this integrating factor, giving new M and new N which are called M and N so not to confuse them with the original M and N.

M=μM=1ay2+b(x(ay2+b))=x

And

N=μN=1ay2+b(1)=1ay2+b

So now a modified ODE is obtained from the original ODE which will be exact and can be solved using the standard method. The modified ODE is

M+Ndydx=0(x)+(1ay2+b)dydx=0

The following equations are now set up to solve for the function ϕ(x,y)

(1)ϕx=M(2)ϕy=N

Integrating (1) w.r.t. x gives

ϕxdx=Mdxϕxdx=xdx(3)ϕ=x22+f(y)

Where f(y) is used for the constant of integration since ϕ is a function of both x and y. Taking derivative of equation (3) w.r.t y gives

(4)ϕy=0+f(y)

But equation (2) says that ϕy=1ay2+b. Therefore equation (4) becomes

(5)1ay2+b=0+f(y)

Solving equation (5) for f(y) gives

f(y)=1ay2+b

Integrating the above w.r.t y gives

f(y)dy=(1ay2+b)dyf(y)=arctan(ayba)ba+c2

Where c2 is constant of integration. Substituting result found above for f(y) into equation (3) gives ϕ

ϕ=x22+arctan(ayba)ba+c2

But since ϕ itself is a constant function, then let ϕ=c3 where c2 is new constant and combining c2 and c3 constants into the constant c2 gives the solution as

c2=x22+arctan(ayba)ba

Solving for y gives

y=tan(x2ba2+c2ba)baa

Which simplifies to

y=tan(ba(x22+c2))baa

Summary of solutions found

y=tan(ba(x22+c2))baa
Solved using first_order_ode_LIE

Time used: 0.394 (sec)

Solve

y=x(ay2+b)

Writing the ode as

y=x(ay2+b)y=ω(x,y)

The condition of Lie symmetry is the linearized PDE given by

(A)ηx+ω(ηyξx)ω2ξyωxξωyη=0

To determine ξ,η then (A) is solved using ansatz. Making bivariate polynomials of degree 2 to use as anstaz gives

(1E)ξ=x2a4+yxa5+y2a6+xa2+ya3+a1(2E)η=x2b4+yxb5+y2b6+xb2+yb3+b1

Where the unknown coefficients are

{a1,a2,a3,a4,a5,a6,b1,b2,b3,b4,b5,b6}

Substituting equations (1E,2E) and ω into (A) gives

(5E)2xb4+yb5+b2+x(ay2+b)(2xa4+xb5ya5+2yb6a2+b3)x2(ay2+b)2(xa5+2ya6+a3)(ay2+b)(x2a4+yxa5+y2a6+xa2+ya3+a1)2xay(x2b4+yxb5+y2b6+xb2+yb3+b1)=0

Putting the above in normal form gives

a2x3y4a52a2x2y5a6a2x2y4a32abx3y2a54abx2y3a62abx2y2a32ax3yb43ax2y2a4ax2y2b52axy3a5ay4a6b2x3a52b2x2ya62ax2yb22axy2a2axy2b3ay3a3b2x2a32axyb1ay2a13bx2a4+bx2b52bxya5+2bxyb6by2a62bxa2+bxb3bya3ba1+2xb4+yb5+b2=0

Setting the numerator to zero gives

(6E)a2x3y4a52a2x2y5a6a2x2y4a32abx3y2a54abx2y3a62abx2y2a32ax3yb43ax2y2a4ax2y2b52axy3a5ay4a6b2x3a52b2x2ya62ax2yb22axy2a2axy2b3ay3a3b2x2a32axyb1ay2a13bx2a4+bx2b52bxya5+2bxyb6by2a62bxa2+bxb3bya3ba1+2xb4+yb5+b2=0

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

{x,y}

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

{x=v1,y=v2}

The above PDE (6E) now becomes

(7E)a2a5v13v242a2a6v12v25a2a3v12v242aba5v13v224aba6v12v232aba3v12v223aa4v12v222aa5v1v23aa6v242ab4v13v2ab5v12v22b2a5v132b2a6v12v22aa2v1v22aa3v232ab2v12v2ab3v1v22b2a3v12aa1v222ab1v1v23ba4v122ba5v1v2ba6v22+bb5v12+2bb6v1v22ba2v1ba3v2+bb3v1ba1+2b4v1+b5v2+b2=0

Collecting the above on the terms vi introduced, and these are

{v1,v2}

Equation (7E) now becomes

(8E)a2a5v13v242aba5v13v222ab4v13v2b2a5v132a2a6v12v25a2a3v12v244aba6v12v23+(2aba33aa4ab5)v12v22+(2b2a62ab2)v12v2+(b2a33ba4+bb5)v122aa5v1v23+(2aa2ab3)v1v22+(2ab12ba5+2bb6)v1v2+(2ba2+bb3+2b4)v1aa6v24aa3v23+(aa1ba6)v22+(ba3+b5)v2ba1+b2=0

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

aa3=02aa5=0aa6=02ab4=0a2a3=0a2a5=02a2a6=0b2a5=02aba5=04aba6=02aa2ab3=0ba1+b2=0ba3+b5=0aa1ba6=02b2a62ab2=02ba2+bb3+2b4=0b2a33ba4+bb5=02aba33aa4ab5=02ab12ba5+2bb6=0

Solving the above equations for the unknowns gives

a1=0a2=0a3=0a4=0a5=0a6=0b1=b1b2=0b3=0b4=0b5=0b6=ab1b

Substituting the above solution in the anstaz (1E,2E) (using 1 as arbitrary value for any unknown in the RHS) gives

ξ=0η=ay2+bb

The next step is to determine the canonical coordinates R,S. The canonical coordinates map (x,y)(R,S) where (R,S) 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

(1)dxξ=dyη=dS

The above comes from the requirements that (ξx+ηy)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 ξ=0 then in this special case

R=x

S is found from

S=1ηdy=1ay2+bbdy

Which results in

S=barctan(ayba)ba

Now that R,S are found, we need to setup the ode in these coordinates. This is done by evaluating

(2)dSdR=Sx+ω(x,y)SyRx+ω(x,y)Ry

Where in the above Rx,Ry,Sx,Sy are all partial derivatives and ω(x,y) is the right hand side of the original ode given by

ω(x,y)=x(ay2+b)

Evaluating all the partial derivatives gives

Rx=1Ry=0Sx=0Sy=bay2+b

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

(2A)dSdR=bx

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

dSdR=bR

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 ddRS(R)=f(R), then we only need to integrate f(R).

dS=bRdRS(R)=bR22+c5

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

barctan(ayb)a=bx22+c5

Solving for y gives

y=btan(a(bx2+2c5)2b)a

Summary of solutions found

y=btan(a(bx2+2c5)2b)a
Solved using first_order_ode_riccati

Time used: 1.382 (sec)

Solve

y=x(ay2+b)

In canonical form the ODE is

y=F(x,y)=x(ay2+b)

This is a Riccati ODE. Comparing the ODE to solve

y=axy2+bx

With Riccati ODE standard form

y=f0(x)+f1(x)y+f2(x)y2

Shows that f0(x)=bx, f1(x)=0 and f2(x)=ax. Let

y=uf2u(1)=uuax

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

(2)f2u(x)(f2+f1f2)u(x)+f22f0u(x)=0

But

f2=af1f2=0f22f0=a2x3b

Substituting the above terms back in equation (2) gives

axu(x)au(x)+a2x3bu(x)=0

Solved as second order ode using change of variable on x method 2

Time used: 0.661 (sec)

In normal form the ode

(1)axuau+a2x3bu=0

Becomes

(2)u+p(x)u+q(x)u=0

Where

p(x)=1xq(x)=ax2b

Applying change of variables τ=g(x) to (2) gives

(3)d2dτ2u(τ)+p1(ddτu(τ))+q1u(τ)=0

Where τ is the new independent variable, and

(4)p1(τ)=τ(x)+p(x)τ(x)τ(x)2(5)q1(τ)=q(x)τ(x)2

Let p1=0. Eq (4) simplifies to

τ(x)+p(x)τ(x)=0

This ode is solved resulting in

τ=ep(x)dxdx=e1xdxdx=eln(x)dx=xdx(6)=x22

Using (6) to evaluate q1 from (5) gives

q1(τ)=q(x)τ(x)2=ax2bx2(7)=ba

Substituting the above in (3) and noting that now p1=0 results in

d2dτ2u(τ)+q1u(τ)=0d2dτ2u(τ)+bau(τ)=0

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

Au(τ)+Bu(τ)+Cu(τ)=0

Where in the above A=1,B=0,C=ba. Let the solution be u=eλτ. Substituting this into the ODE gives

(1)λ2eτλ+baeτλ=0

Since exponential function is never zero, then dividing Eq(2) throughout by eλτ gives

(2)ba+λ2=0

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

λ1,2=B2A±12AB24AC

Substituting A=1,B=0,C=ba into the above gives

λ1,2=0(2)(1)±1(2)(1)02(4)(1)(ba)=±ba

Hence

λ1=+baλ2=ba

Which simplifies to

λ1=((1+i)signum(ba)+1+i)ba2λ2=((1+i)signum(ba)+1+i)ba2

The roots are complex but they are not conjugate of each others. Hence simplification using Euler relation is not possible here. Therefore the final solution is

u=c6eλ1τ+c7eλ2τ=c6eτ((1+i)signum(ba)+1+i)ba2+c7eτ((1+i)signum(ba)+1+i)ba2

Will add steps showing solving for IC soon.

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

u(x)=c6ex2((1+i)signum(ba)+1+i)ba4+c7ex2((1+i)signum(ba)+1+i)ba4

Will add steps showing solving for IC soon.

Summary of solutions found

u(x)=c6ex2((1+i)signum(ba)+1+i)ba4+c7ex2((1+i)signum(ba)+1+i)ba4

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

Time used: 0.102 (sec)

Solve

axuau+a2x3bu=0

In normal form the ode

(1)axuau+a2x3bu=0

Becomes

(2)u+p(x)u+q(x)u=0

Where

p(x)=1xq(x)=ax2b

Applying change of variables τ=g(x) to (2) results

(3)d2dτ2u(τ)+p1(ddτu(τ))+q1u(τ)=0

Where τ is the new independent variable, and

(4)p1(τ)=τ(x)+p(x)τ(x)τ(x)2(5)q1(τ)=q(x)τ(x)2

Let q1=c2 where c is some constant. Therefore from (5)

τ=1cq(6)=ax2bcτ=axbcax2b

Substituting the above into (4) results in

p1(τ)=τ(x)+p(x)τ(x)τ(x)2=axbcax2b1xax2bc(ax2bc)2=0

Therefore ode (3) now becomes

u(τ)+p1u(τ)+q1u(τ)=0(7)d2dτ2u(τ)+c2u(τ)=0

The above ode is now solved for u(τ). Since the ode is now constant coefficients, it can be easily solved to give

u(τ)=c1cos(cτ)+c2sin(cτ)

Now from (6)

τ=1cqdx=ax2bdxc=xax2b2c

Substituting the above into the solution obtained gives

u=c1cos(xax2b2)+c2sin(xax2b2)

Will add steps showing solving for IC soon.

Summary of solutions found

u=c1cos(xax2b2)+c2sin(xax2b2)

Solved as second order Bessel ode

Time used: 0.082 (sec)

Solve

axuau+a2x3bu=0

Writing the ode as

(1)x2uux+ax4bu=0

Bessel ode has the form

(2)x2u+ux+(n2+x2)u=0

The generalized form of Bessel ode is given by Bowman (1958) as the following

(3)x2u+(12α)xu+(β2γ2x2γn2γ2+α2)u=0

With the standard solution

(4)u=xα(c1BesselJ(n,βxγ)+c2BesselY(n,βxγ))

Comparing (3) to (1) and solving for α,β,n,γ gives

α=1β=ba2n=12γ=2

Substituting all the above into (4) gives the solution as

u=2c1xsin(x2ba2)πx2ba2c2xcos(x2ba2)πx2ba

Will add steps showing solving for IC soon.

Summary of solutions found

u=2c1xsin(x2ba2)πx2ba2c2xcos(x2ba2)πx2ba

Solved as second order ode using Kovacic algorithm

Time used: 0.401 (sec)

Solve

axuau+a2x3bu=0

Writing the ode as

(1)axuau+a2x3bu=0(2)Au+Bu+Cu=0

Comparing (1) and (2) shows that

A=ax(3)B=aC=a2x3b

Applying the Liouville transformation on the dependent variable gives

z(x)=ueB2Adx

Then (2) becomes

(4)z(x)=rz(x)

Where r is given by

(5)r=st=2AB2BA+B24AC4A2

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

(6)r=4ax4b+34x2

Comparing the above to (5) shows that

s=4ax4b+3t=4x2

Therefore eq. (4) becomes

(7)z(x)=(4ax4b+34x2)z(x)

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

u=z(x)eB2Adx

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 . The following table summarizes these cases.

Case

Allowed pole order for r

Allowed value for O()

1

{0,1,2,4,6,8,}

{,6,4,2,0,2,3,4,5,6,}

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

{1,2}

{2,3,4,5,6,7,}

Table 2.11: Necessary conditions for each Kovacic case

The order of r at is the degree of t minus the degree of s. Therefore

O()=deg(t)deg(s)=24=2

The poles of r in eq. (7) and the order of each pole are determined by solving for the roots of t=4x2. There is a pole at x=0 of order 2. Since there is no odd order pole larger than 2 and the order at 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. Therefore

L=[1,2]

Attempting to find a solution using case n=1.

Looking at poles of order 2. The partial fractions decomposition of r is

r=ax2b+34x2

For the pole at x=0 let b be the coefficient of 1x2 in the partial fractions decomposition of r given above. Therefore b=34. Hence

[r]c=0αc+=12+1+4b=32αc=121+4b=12

Since the order of r at is Or()=2 then

v=Or()2=22=1

[r] is the sum of terms involving xi for 0iv in the Laurent series for r at . Therefore

[r]=i=0vaixi(8)=i=01aixi

Let a be the coefficient of xv=x1 in the above sum. The Laurent series of r at is

(9)ribax3i8bax39i128b3/2a3/2x727i1024b5/2a5/2x11405i32768b7/2a7/2x151701i262144b9/2a9/2x1915309i4194304b11/2a11/2x2372171i33554432b13/2a13/2x27+

Comparing Eq. (9) with Eq. (8) shows that

a=iba

From Eq. (9) the sum up to v=1 gives

[r]=i=01aixi(10)=ibax

Now we need to find b, where b be the coefficient of xv1=x0=1 in r minus the coefficient of same term but in ([r])2 where [r] was found above in Eq (10). Hence

([r])2=ax2b

This shows that the coefficient of 1 in the above is 0. Now we need to find the coefficient of 1 in r. How this is done depends on if v=0 or not. Since v=1 which is not zero, then starting r=st, we do long division and write this in the form

r=Q+Rt

Where Q is the quotient and R is the remainder. Then the coefficient of 1 in r will be the coefficient this term in the quotient. Doing long division gives

r=st=4ax4b+34x2=Q+R4x2=(ax2b)+(34x2)=ax2b+34x2

We see that the coefficient of the term x in the quotient is 0. Now b can be found.

b=(0)(0)=0

Hence

[r]=ibaxα+=12(bav)=12(0iba1)=12α=12(bav)=12(0iba1)=12

The following table summarizes the findings so far for poles and for the order of r at where r is

r=4ax4b+34x2

pole c location pole order [r]c αc+ αc
0 2 0 32 12

Order of r at [r] α+ α
2 ibax 12 12

Now that the all [r]c and its associated αc± have been determined for all the poles in the set Γ and [r] and its associated α± have also been found, the next step is to determine possible non negative integer d from these using

d=αs()cΓαcs(c)

Where s(c) is either + or and s() is the sign of α±. This is done by trial over all set of families s=(s(c))cΓ until such d is found to work in finding candidate ω. Trying α=12 then

d=α(αc1)=12(12)=0

Since d an integer and d0 then it can be used to find ω using

ω=cΓ(s(c)[r]c+αcs(c)xc)+s()[r]

The above gives

ω=(()[r]c1+αc1xc1)+()[r]=12x+()(ibax)=12xibax=2ibax212x

Now that ω 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

(1A)p+2ωp+(ω+ω2r)p=0

Let

(2A)p(x)=1

Substituting the above in eq. (1A) gives

(0)+2(12xibax)(0)+((12x2iba)+(12xibax)2(4ax4b+34x2))=00=0

The equation is satisfied since both sides are zero. Therefore the first solution to the ode z=rz is

z1(x)=peωdx=e(12xibax)dx=eibax22x

The first solution to the original ode in u is found from

u1=z1e12BAdx=z1e12aaxdx=z1eln(x)2=z1(x)

Which simplifies to

u1=eix2ba2

The second solution u2 to the original ode is found using reduction of order

u2=u1eBAdxu12dx

Substituting gives

u2=u1eaaxdx(u1)2dx=u1eln(x)(u1)2dx=u1(ieix2ba2ba)

Therefore the solution is

u=c1u1+c2u2=c1(eix2ba2)+c2(eix2ba2(ieix2ba2ba))

Will add steps showing solving for IC soon.

Summary of solutions found

u=c1eix2ba2ic2eix2ba22ba

Taking derivative gives

u(x)=c6x((1+i)signum(ba)+1+i)baex2((1+i)signum(ba)+1+i)ba42c7x((1+i)signum(ba)+1+i)baex2((1+i)signum(ba)+1+i)ba42

Doing change of constants, the solution becomes

y=c1x((1+i)signum(ba)+1+i)baex2((1+i)signum(ba)+1+i)ba42x((1+i)signum(ba)+1+i)baex2((1+i)signum(ba)+1+i)ba42ax(c1ex2((1+i)signum(ba)+1+i)ba4+ex2((1+i)signum(ba)+1+i)ba4)

Summary of solutions found

y=c1x((1+i)signum(ba)+1+i)baex2((1+i)signum(ba)+1+i)ba42x((1+i)signum(ba)+1+i)baex2((1+i)signum(ba)+1+i)ba42ax(c1ex2((1+i)signum(ba)+1+i)ba4+ex2((1+i)signum(ba)+1+i)ba4)
Maple. Time used: 0.005 (sec). Leaf size: 28
ode:=diff(y(x),x) = x*(a*y(x)^2+b); 
dsolve(ode,y(x), singsol=all);
 
y=tan(ba(x2+2c1)2)baa

Maple trace

Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying 1st order linear 
trying Bernoulli 
trying separable 
<- separable successful
 

Maple step by step

Let’s solveddxy(x)=x(ay(x)2+b)Highest derivative means the order of the ODE is1ddxy(x)Solve for the highest derivativeddxy(x)=x(ay(x)2+b)Separate variablesddxy(x)ay(x)2+b=xIntegrate both sides with respect toxddxy(x)ay(x)2+bdx=xdx+C1Evaluate integralarctan(ay(x)ba)ba=x22+C1Solve fory(x)y(x)=tan(x2ba2+C1ba)baaSimplifyy(x)=tan(ba(x22+C1))baaRedefine the integration constant(s)y(x)=tan(C1+x2ba2)baa
Mathematica. Time used: 8.114 (sec). Leaf size: 75
ode=D[y[x],x]==x*(a*y[x]^2+b); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)btan(12ab(x2+2c1))ay(x)ibay(x)iba
Sympy. Time used: 1.585 (sec). Leaf size: 63
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
y = Function("y") 
ode = Eq(-x*(a*y(x)**2 + b) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
x221ablog(b1ab+y(x))2+1ablog(b1ab+y(x))2=C1