2.3.3 Problem 3

Solved as first order polynomial type ode
Solved as first order homogeneous class Maple C ode
Solved as first order Exact ode
Solved using Lie symmetry for first order ode
Solved as first order ode of type dAlembert
Maple
Mathematica
Sympy

Internal problem ID [18468]
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 29. Problems at page 81
Problem number : 3
Date solved : Thursday, March 13, 2025 at 12:03:03 PM
CAS classification : [[_homogeneous, `class C`], _exact, _rational, [_Abel, `2nd type`, `class A`]]

Solve

y=2ax+byg2cy+bx+e

Solved as first order polynomial type ode

Time used: 0.411 (sec)

This is ODE of type polynomial. Where the RHS of the ode is ratio of equations of two lines. Writing the ODE in the form

y=a1x+b1y+c1a2x+b2y+c3

Where a1=2a,b1=b,c1=g,a2=b,b2=2c,c2=e. There are now two possible solution methods. The first case is when the two lines a1x+b1y+c1,a2x+b2y+c3 are not parallel and the second case is if they are parallel. If they are not parallel, then the transformation X=xx0, Y=yy0 converts the ODE to a homogeneous ODE. The values x0,y0 have to be determined. If they are parallel then a transformation U(x)=a1x+b1y converts the given ODE in y to a separable ODE in U(x). The first case is when a1b1a2b2 and the second case when a1b1=a2b2. From the above we see that a1b1a2b2. Hence this is case one where lines are not parallel. Using the transformation

X=xx0Y=yy0

Where the constants x0,y0 are obtained by solving the following two linear algebraic equations

a1x0+b1y0+c1=0a2x0+b2y0+c2=0

Substituting the values for a1,b1,c1,a2,b2,c2 gives

2ax0by0+g=0bx0+2cy0+e=0

Solving for x0,y0 from the above gives

x0=be+2cg4acb2y0=2ae+bg4acb2

Therefore the transformation becomes

X=x|be+2cg4acb2|Y=y+|2ae+bg4acb2|

Using this transformation in 2ax+by+(2cy+bx+e)y=g result in

dYdX=2XaYbXb+2Yc

This is now a homogeneous ODE which will now be solved for Y(X). In canonical form, the ODE is

Y=F(X,Y)(1)=2Xa+YbXb+2Yc

An ode of the form Y=M(X,Y)N(X,Y) is called homogeneous if the functions M(X,Y) and N(X,Y) are both homogeneous functions and of the same order. Recall that a function f(X,Y) is homogeneous of order n if

f(tnX,tnY)=tnf(X,Y)

In this case, it can be seen that both M=2XaYb and N=Xb+2Yc are both homogeneous and of the same order n=1. Therefore this is a homogeneous ode. Since this ode is homogeneous, it is converted to separable ODE using the substitution u=YX, or Y=uX. Hence

dYdX=dudXX+u

Applying the transformation Y=uX to the above ODE in (1) gives

dudXX+u=bu2a2cu+bdudX=bu(X)2a2cu(X)+bu(X)X

Or

ddXu(X)bu(X)2a2cu(X)+bu(X)X=0

Or

2u(X)(ddXu(X))Xc+2u(X)2c+(ddXu(X))Xb+2bu(X)+2a=0

Or

X(2cu(X)+b)(ddXu(X))+2u(X)2c+2bu(X)+2a=0

Which is now solved as separable in u(X).

The ode

(1)ddXu(X)=2(u(X)2c+bu(X)+a)X(2cu(X)+b)

is separable as it can be written as

ddXu(X)=2(u(X)2c+bu(X)+a)X(2cu(X)+b)=f(X)g(u)

Where

f(X)=2Xg(u)=u2c+bu+a2cu+b

Integrating gives

1g(u)du=f(X)dX2cu+bu2c+bu+adu=2XdX
ln(u(X)2c+bu(X)+a)=ln(1X2)+c2

Taking the exponential of both sides the solution becomes

u(X)2c+bu(X)+a=c2X2

Converting u(X)2c+bu(X)+a=c2X2 back to Y(X) gives

Y(X)2c+bY(X)X+aX2=c2

The solution is implicit Y(X)2c+bY(X)X+aX2=c2. Replacing Y=yy0,X=xx0 gives

a(xbe+2cg4acb2)2+(y+2ae+bg4acb2)b(xbe+2cg4acb2)+(y+2ae+bg4acb2)2c=c2

Summary of solutions found

a(xbe+2cg4acb2)2+(y+2ae+bg4acb2)b(xbe+2cg4acb2)+(y+2ae+bg4acb2)2c=c2
Solved as first order homogeneous class Maple C ode

Time used: 0.930 (sec)

Let Y=yy0 and X=xx0 then the above is transformed to new ode in Y(X)

ddXY(X)=2a(X+x0)+b(Y(X)+y0)g2c(Y(X)+y0)+b(X+x0)+e

Solving for possible values of x0 and y0 which makes the above ode a homogeneous ode results in

x0=be+2cg4acb2y0=2aebg4acb2

Using these values now it is possible to easily solve for Y(X). The above ode now becomes

ddXY(X)=2aX+bY(X)+2a(be+2cg)4acb2+b(2aebg)4acb2gbX+2cY(X)+b(be+2cg)4acb2+2c(2aebg)4acb2+e

In canonical form, the ODE is

Y=F(X,Y)(1)=2aX+bYbX+2cY

An ode of the form Y=M(X,Y)N(X,Y) is called homogeneous if the functions M(X,Y) and N(X,Y) are both homogeneous functions and of the same order. Recall that a function f(X,Y) is homogeneous of order n if

f(tnX,tnY)=tnf(X,Y)

In this case, it can be seen that both M=2aXbY and N=bX+2cY are both homogeneous and of the same order n=1. Therefore this is a homogeneous ode. Since this ode is homogeneous, it is converted to separable ODE using the substitution u=YX, or Y=uX. Hence

dYdX=dudXX+u

Applying the transformation Y=uX to the above ODE in (1) gives

dudXX+u=bu2a2cu+bdudX=bu(X)2a2cu(X)+bu(X)X

Or

ddXu(X)bu(X)2a2cu(X)+bu(X)X=0

Or

2(ddXu(X))u(X)Xc+(ddXu(X))Xb+2u(X)2c+2bu(X)+2a=0

Or

X(2cu(X)+b)(ddXu(X))+2u(X)2c+2bu(X)+2a=0

Which is now solved as separable in u(X).

The ode

(2)ddXu(X)=2(u(X)2c+bu(X)+a)X(2cu(X)+b)

is separable as it can be written as

ddXu(X)=2(u(X)2c+bu(X)+a)X(2cu(X)+b)=f(X)g(u)

Where

f(X)=2Xg(u)=u2c+bu+a2cu+b

Integrating gives

1g(u)du=f(X)dX2cu+bu2c+bu+adu=2XdX
ln(u(X)2c+bu(X)+a)=ln(1X2)+c1

Taking the exponential of both sides the solution becomes

u(X)2c+bu(X)+a=c1X2

Converting u(X)2c+bu(X)+a=c1X2 back to Y(X) gives

Y(X)2c+bY(X)X+X2a=c1

Using the solution for Y(X)

(A)Y(X)2c+bY(X)X+X2a=c1

And replacing back terms in the above solution using

Y=y+y0X=x0+x

Or

Y=y+2aebg4acb2X=x+be+2cg4acb2

Then the solution in y becomes using EQ (A)

(y2aebg4acb2)2c+b(y2aebg4acb2)(xbe+2cg4acb2)+a(xbe+2cg4acb2)2=c1

Solving for y gives

y=4abcx+b3x4ace+b2e+64a3c3x2+48a2b2c2x212ab4cx2+b6x2+32a2bc2ex+64a2c3gx16ab3cex32ab2c2gx+2b5ex+4b4cgx+64c1a2c332c1ab2c2+4c1b4c4ab2ce216abc2eg16ac3g2+b4e2+4b3ceg+4b2c2g22c(4acb2)y=4abcxb3x+4aceb2e+64a3c3x2+48a2b2c2x212ab4cx2+b6x2+32a2bc2ex+64a2c3gx16ab3cex32ab2c2gx+2b5ex+4b4cgx+64c1a2c332c1ab2c2+4c1b4c4ab2ce216abc2eg16ac3g2+b4e2+4b3ceg+4b2c2g22c(4acb2)

Solved as first order Exact ode

Time used: 0.434 (sec)

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

(bx+2cy+e)dy=(2axby+g)dx(2A)(2ax+byg)dx+(bx+2cy+e)dy=0

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

M(x,y)=2ax+bygN(x,y)=bx+2cy+e

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(2ax+byg)=b

And

Nx=x(bx+2cy+e)=b

Since My=Nx, then the ODE is exact 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=2ax+bygdx(3)ϕ=x(ax+byg)+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=bx+f(y)

But equation (2) says that ϕy=bx+2cy+e. Therefore equation (4) becomes

(5)bx+2cy+e=bx+f(y)

Solving equation (5) for f(y) gives

f(y)=2cy+e

Integrating the above w.r.t y gives

f(y)dy=(2cy+e)dyf(y)=y2c+ey+c1

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

ϕ=x(ax+byg)+y2c+ey+c1

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

c1=x(ax+byg)+y2c+ey

Solving for y gives

y=bxe+4acx2+b2x2+2bex+4cgx+4c1c+e22cy=bx+4acx2+b2x2+2bex+4cgx+4c1c+e2+e2c

Summary of solutions found

y=bxe+4acx2+b2x2+2bex+4cgx+4c1c+e22cy=bx+4acx2+b2x2+2bex+4cgx+4c1c+e2+e2c
Solved using Lie symmetry for first order ode

Time used: 0.820 (sec)

Writing the ode as

y=2ax+bygbx+2cy+ey=ω(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 1 to use as anstaz gives

(1E)ξ=xa2+ya3+a1(2E)η=xb2+yb3+b1

Where the unknown coefficients are

{a1,a2,a3,b1,b2,b3}

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

(5E)b2(2ax+byg)(b3a2)bx+2cy+e(2ax+byg)2a3(bx+2cy+e)2(2abx+2cy+e+(2ax+byg)b(bx+2cy+e)2)(xa2+ya3+a1)(bbx+2cy+e+2(2ax+byg)c(bx+2cy+e)2)(xb2+yb3+b1)=0

Putting the above in normal form gives

4a2x2a32abx2a2+2abx2b3+4abxya3+4acx2b28acxya2+8acxyb34acy2a32b2x2b2+2b2y2a34bcxyb22bcy2a2+2bcy2b34c2y2b2+4acxb14acya14aexa2+2aexb32aeya34agxa3b2xb1+b2ya13bexb2beya2bgxb33bgya34ceyb22cgxb2+2cgya24cgyb32aea1beb1bga12cgb1e2b2+ega2egb3+g2a3(bx+2cy+e)2=0

Setting the numerator to zero gives

(6E)4a2x2a3+2abx2a22abx2b34abxya34acx2b2+8acxya28acxyb3+4acy2a3+2b2x2b22b2y2a3+4bcxyb2+2bcy2a22bcy2b3+4c2y2b24acxb1+4acya1+4aexa22aexb3+2aeya3+4agxa3+b2xb1b2ya1+3bexb2+beya2+bgxb3+3bgya3+4ceyb2+2cgxb22cgya2+4cgyb3+2aea1+beb1+bga1+2cgb1+e2b2ega2+egb3g2a3=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)4a2a3v12+2aba2v124aba3v1v22abb3v12+8aca2v1v2+4aca3v224acb2v128acb3v1v22b2a3v22+2b2b2v12+2bca2v22+4bcb2v1v22bcb3v22+4c2b2v22+4aca1v24acb1v1+4aea2v1+2aea3v22aeb3v1+4aga3v1b2a1v2+b2b1v1+bea2v2+3beb2v1+3bga3v2+bgb3v1+4ceb2v22cga2v2+2cgb2v1+4cgb3v2+2aea1+beb1+bga1+2cgb1+e2b2ega2+egb3g2a3=0

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

{v1,v2}

Equation (7E) now becomes

(8E)(4a2a3+2aba22abb34acb2+2b2b2)v12+(4aba3+8aca28acb3+4bcb2)v1v2+(4acb1+4aea22aeb3+4aga3+b2b1+3beb2+bgb3+2cgb2)v1+(4aca32b2a3+2bca22bcb3+4c2b2)v22+(4aca1+2aea3b2a1+bea2+3bga3+4ceb22cga2+4cgb3)v2+2aea1+beb1+bga1+2cgb1+e2b2ega2+egb3g2a3=0

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

4aba3+8aca28acb3+4bcb2=04aca32b2a3+2bca22bcb3+4c2b2=04a2a3+2aba22abb34acb2+2b2b2=04aca1+2aea3b2a1+bea2+3bga3+4ceb22cga2+4cgb3=04acb1+4aea22aeb3+4aga3+b2b1+3beb2+bgb3+2cgb2=02aea1+beb1+bga1+2cgb1+e2b2ega2+egb3g2a3=0

Solving the above equations for the unknowns gives

a1=2acea3b2ea3bceb3bcga32c2gb3c(4acb2)a2=ba3+cb3ca3=a3b1=abea3+2aceb3+2acga3+bcgb3c(4acb2)b2=aa3cb3=b3

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

ξ=4xacb2xbe2cg4acb2η=4acyb2y+2ae+bg4acb2

Shifting is now applied to make ξ=0 in order to simplify the rest of the computation

η=ηω(x,y)ξ=4acyb2y+2ae+bg4acb2(2ax+bygbx+2cy+e)(4xacb2xbe2cg4acb2)=8a2cx22ab2x2+8abcxy+8ac2y22b3xy2b2cy2+8acey8acgx2b2ey+2b2gx+2ae2+2beg+2cg24abcx+8ac2yb3x2b2cy+4aceb2eξ=0

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=18a2cx22ab2x2+8abcxy+8ac2y22b3xy2b2cy2+8acey8acgx2b2ey+2b2gx+2ae2+2beg+2cg24abcx+8ac2yb3x2b2cy+4aceb2edy

Which results in

S=ln(4a2cx2ab2x2+4abcxy+4ac2y2b3xyb2cy2+4acey4acgxb2ey+b2gx+ae2+beg+cg2)2

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)=2ax+bygbx+2cy+e

Evaluating all the partial derivatives gives

Rx=1Ry=0Sx=(2ax+byg)(4acb2)8a2cx2+(2b2x2+8bcxy+8c2y2+(8ey8gx)c+2e2)a2(byg)(b2x+(cy+e)b+cg)Sy=(bx+2cy+e)(4acb2)8a2cx2+(2b2x2+8bcxy+8c2y2+(8ey8gx)c+2e2)a2(byg)(b2x+(cy+e)b+cg)

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

(2A)dSdR=0

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=0

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=0dR+c2S(R)=c2

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

ln(4a2cx2+(b2x2+4bcxy4cgx+4(cy+e2)2)a(byg)(b2x+(cy+e)b+cg))2=c2

Summary of solutions found

ln(4a2cx2+(b2x2+4bcxy4cgx+4(cy+e2)2)a(byg)(b2x+(cy+e)b+cg))2=c2
Solved as first order ode of type dAlembert

Time used: 0.629 (sec)

Let p=y the ode becomes

p=2ax+bygbx+2cy+e

Solving for y from the above results in

(1)y=(bp+2a)x2cp+bepg2cp+b

This has the form

(*)y=xf(p)+g(p)

Where f,g are functions of p=y(x). The above ode is dAlembert ode which is now solved.

Taking derivative of (*) w.r.t. x gives

p=f+(xf+g)dpdx(2)pf=(xf+g)dpdx

Comparing the form y=xf+g to (1A) shows that

f=bp2a2cp+bg=ep+g2cp+b

Hence (2) becomes

(2A)pbp2a2cp+b=(xb2cp+b+2xcbp(2cp+b)2+4xca(2cp+b)2e2cp+b+2cep(2cp+b)22cg(2cp+b)2)p(x)

The singular solution is found by setting dpdx=0 in the above which gives

pbp2a2cp+b=0

Solving the above for p results in

p1=b+4ac+b22cp2=b+4ac+b22c

Substituting these in (1A) and keeping singular solution that verifies the ode gives

y=bx4ac+b24xac+b2xe4ac+b2+be+2cg2c4ac+b2y=bx4ac+b2+4xacb2xe4ac+b2be2cg24ac+b2c

The general solution is found when dpdx0. From eq. (2A). This results in

(3)p(x)=p(x)bp(x)2a2cp(x)+bxb2cp(x)+b+2xcbp(x)(2cp(x)+b)2+4xca(2cp(x)+b)2e2cp(x)+b+2cep(x)(2cp(x)+b)22cg(2cp(x)+b)2

This ODE is now solved for p(x). No inversion is needed.

The ode

(3)p(x)=2(2cp(x)+b)(p(x)2c+bp(x)+a)4xacb2xbe2cg

is separable as it can be written as

p(x)=2(2cp(x)+b)(p(x)2c+bp(x)+a)4xacb2xbe2cg=f(x)g(p)

Where

f(x)=24xacb2xbe2cgg(p)=(2cp+b)(cp2+bp+a)

Integrating gives

1g(p)dp=f(x)dx1(2cp+b)(cp2+bp+a)dp=24xacb2xbe2cgdx
ln((2cp(x)+b)2p(x)2c+bp(x)+a)4acb2=2ln((4acb2)xbe2cg)4acb2+c1

Taking the exponential of both sides the solution becomes

((2cp(x)+b)2p(x)2c+bp(x)+a)14acb2=c1((4acb2)xbe2cg)24acb2

Substituing the above solution for p in (2A) gives

y=x(bRootOf(((2_Zc+b)2c_Z2+b_Z+a)14acb2+c1(4xacb2xbe2cg)24acb2)2a)2cRootOf(((2_Zc+b)2c_Z2+b_Z+a)14acb2+c1(4xacb2xbe2cg)24acb2)+b+eRootOf(((2_Zc+b)2c_Z2+b_Z+a)14acb2+c1(4xacb2xbe2cg)24acb2)+g2cRootOf(((2_Zc+b)2c_Z2+b_Z+a)14acb2+c1(4xacb2xbe2cg)24acb2)+b

Summary of solutions found

y=bx4ac+b24xac+b2xe4ac+b2+be+2cg2c4ac+b2y=bx4ac+b2+4xacb2xe4ac+b2be2cg24ac+b2cy=x(bRootOf(((2_Zc+b)2c_Z2+b_Z+a)14acb2+c1(4xacb2xbe2cg)24acb2)2a)2cRootOf(((2_Zc+b)2c_Z2+b_Z+a)14acb2+c1(4xacb2xbe2cg)24acb2)+b+eRootOf(((2_Zc+b)2c_Z2+b_Z+a)14acb2+c1(4xacb2xbe2cg)24acb2)+g2cRootOf(((2_Zc+b)2c_Z2+b_Z+a)14acb2+c1(4xacb2xbe2cg)24acb2)+b
Maple. Time used: 0.105 (sec). Leaf size: 90
ode:=2*a*x+b*y(x)+(2*c*y(x)+b*x+e)*diff(y(x),x) = g; 
dsolve(ode,y(x), singsol=all);
 
y(x)=64(acb24)((axg2)cb(bx+e)4)2c12+4c+(4abcx+b3x4ace+b2e)c18(acb24)cc1

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 C 
trying homogeneous types: 
trying homogeneous D 
<- homogeneous successful 
<- homogeneous successful`
 

Maple step by step

Let’s solve2ax+by+(2cy+bx+e)y=gHighest derivative means the order of the ODE is1yCheck if ODE is exactODE is exact if the lhs is the total derivative of aC2functionF(x,y)=0Compute derivative of lhsF(x,y)+(yF(x,y))y=0Evaluate derivativesb=bCondition met, ODE is exactExact ODE implies solution will be of this form[F(x,y)=C1,M(x,y)=F(x,y),N(x,y)=yF(x,y)]Solve forF(x,y)by integratingM(x,y)with respect toxF(x,y)=(2ax+byg)dx+_F1(y)Evaluate integralF(x,y)=ax2+bxygx+_F1(y)Take derivative ofF(x,y)with respect toyN(x,y)=yF(x,y)Compute derivativebx+2cy+e=bx+ddy_F1(y)Isolate forddy_F1(y)ddy_F1(y)=2cy+eSolve for_F1(y)_F1(y)=y2c+eySubstitute_F1(y)into equation forF(x,y)F(x,y)=ax2+bxy+y2c+eygxSubstituteF(x,y)into the solution of the ODEax2+bxy+y2c+eygx=C1Solve fory{y=bxe+4acx2+b2x2+2bex+4cgx+4C1c+e22c,y=bx+4acx2+b2x2+2bex+4cgx+4C1c+e2+e2c}
Mathematica. Time used: 17.046 (sec). Leaf size: 132
ode=(2*a*x+b*y[x])+(2*c*y[x]+b*x+e)*D[y[x],x]==g; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)4cx(gax)+b2x2+2bex+4c2c1+e2c1c+bx+e2cy(x)4cx(gax)+b2x2+2bex+4c2c1+e2c1c+bx+e2c
Sympy
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
e = symbols("e") 
g = symbols("g") 
y = Function("y") 
ode = Eq(2*a*x + b*y(x) - g + (b*x + 2*c*y(x) + e)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -(-2*a*x - b*y(x) + g)/(b*x + 2*c*y(x) + e) + Derivative(y(x), x) cannot be solved by the factorable group method