2.1.22 Problem 23

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

Internal problem ID [8734]
Book : Own collection of miscellaneous problems
Section : section 1.0
Problem number : 23
Date solved : Wednesday, March 05, 2025 at 06:42:44 AM
CAS classification : [[_homogeneous, `class A`], _rational, [_Abel, `2nd type`, `class B`]]

Solve

y=y2x(x+y)

Solved as first order homogeneous class A ode

Time used: 0.728 (sec)

In canonical form, the ODE is

y=F(x,y)(1)=y2x(x+y)

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=y2 and N=x(xy) are both homogeneous and of the same order n=2. 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=u2u1dudx=u(x)2u(x)1u(x)x

Or

u(x)u(x)2u(x)1u(x)x=0

Or

u(x)xu(x)u(x)xu(x)=0

Or

x(u(x)1)u(x)u(x)=0

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

The ode

(1)u(x)=u(x)x(u(x)1)

is separable as it can be written as

u(x)=u(x)x(u(x)1)=f(x)g(u)

Where

f(x)=1xg(u)=uu1

Integrating gives

1g(u)du=f(x)dxu1udu=1xdx
u(x)+ln(1u(x))=ln(x)+c1

Converting u(x)+ln(1u(x))=ln(x)+c1 back to y gives

ln(xy)x+yx=ln(x)+c1

Solving for y gives

y=c1x+ln(x)xln(1LambertW(ec1x))x
Figure 2.47: Slope field y=y2x(x+y)

Summary of solutions found

y=c1x+ln(x)xln(1LambertW(ec1x))x
Solved as first order homogeneous class D2 ode

Time used: 0.409 (sec)

Applying change of variables y=u(x)x, then the ode becomes

u(x)x+u(x)=u(x)2xx+u(x)x

Which is now solved The ode

(2)u(x)=u(x)x(u(x)1)

is separable as it can be written as

u(x)=u(x)x(u(x)1)=f(x)g(u)

Where

f(x)=1xg(u)=uu1

Integrating gives

1g(u)du=f(x)dxu1udu=1xdx
u(x)+ln(1u(x))=ln(x)+c1

Converting u(x)+ln(1u(x))=ln(x)+c1 back to y gives

yx+ln(xy)=ln(x)+c1

Solving for y gives

y=c1x+ln(x)xln(1LambertW(ec1x))x
Figure 2.48: Slope field y=y2x(x+y)

Summary of solutions found

y=c1x+ln(x)xln(1LambertW(ec1x))x
Solved as first order homogeneous class Maple C ode

Time used: 0.588 (sec)

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

ddXY(X)=(Y(X)+y0)2(X+x0)(Xx0+Y(X)+y0)

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

x0=0y0=0

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

ddXY(X)=Y(X)2X2+XY(X)

In canonical form, the ODE is

Y=F(X,Y)(1)=Y2X(X+Y)

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=Y2 and N=X(XY) are both homogeneous and of the same order n=2. 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=u2u1dudX=u(X)2u(X)1u(X)X

Or

ddXu(X)u(X)2u(X)1u(X)X=0

Or

(ddXu(X))Xu(X)(ddXu(X))Xu(X)=0

Or

X(u(X)1)(ddXu(X))u(X)=0

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

The ode

(3)ddXu(X)=u(X)X(u(X)1)

is separable as it can be written as

ddXu(X)=u(X)X(u(X)1)=f(X)g(u)

Where

f(X)=1Xg(u)=uu1

Integrating gives

1g(u)du=f(X)dXu1udu=1XdX
u(X)+ln(1u(X))=ln(X)+c1

Converting u(X)+ln(1u(X))=ln(X)+c1 back to Y(X) gives

ln(XY(X))X+Y(X)X=ln(X)+c1

Using the solution for Y(X)

(A)ln(XY(X))X+Y(X)X=ln(X)+c1

And replacing back terms in the above solution using

Y=y+y0X=x0+x

Or

Y=yX=x

Then the solution in y becomes using EQ (A)

ln(xy)x+yx=ln(x)+c1

Solving for y gives

y=c1x+ln(x)xln(1LambertW(ec1x))x
Figure 2.49: Slope field y=y2x(x+y)
Solved as first order Exact ode

Time used: 0.240 (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

(x(x+y))dy=(y2)dx(2A)(y2)dx+(x(x+y))dy=0

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

M(x,y)=y2N(x,y)=x(x+y)

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(y2)=2y

And

Nx=x(x(x+y))=2x+y

Since MyNx, then the ODE is not exact. By inspection 1x2y is an integrating factor. Therefore by multiplying M=y2 and N=x(x+y) by this integrating factor the ode becomes exact. The new M,N are

M=yx2N=x+yxy

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

(x+yxy)dy=(yx2)dx(2A)(yx2)dx+(x+yxy)dy=0

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

M(x,y)=yx2N(x,y)=x+yxy

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(yx2)=1x2

And

Nx=x(x+yxy)=1x2

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=yx2dx(3)ϕ=yx+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=1x+f(y)

But equation (2) says that ϕy=x+yxy. Therefore equation (4) becomes

(5)x+yxy=1x+f(y)

Solving equation (5) for f(y) gives

f(y)=1y

Integrating the above w.r.t y gives

f(y)dy=(1y)dyf(y)=ln(y)+c1

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

ϕ=yxln(y)+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=yxln(y)

Solving for y gives

y=eLambertW(ec1x)c1
Figure 2.50: Slope field y=y2x(x+y)

Summary of solutions found

y=eLambertW(ec1x)c1
Solved as first order isobaric ode

Time used: 0.474 (sec)

Solving for y gives

(1)y=y2x(x+y)

Each of the above ode’s is now solved An ode y=f(x,y) is isobaric if

(1)f(tx,tmy)=tm1f(x,y)

Where here

(2)f(x,y)=y2x(x+y)

m is the order of isobaric. Substituting (2) into (1) and solving for m gives

m=1

Since the ode is isobaric of order m=1, then the substitution

y=uxm=ux

Converts the ODE to a separable in u(x). Performing this substitution gives

u(x)+xu(x)=xu(x)2x+xu(x)

The ode

(4)u(x)=u(x)x(u(x)1)

is separable as it can be written as

u(x)=u(x)x(u(x)1)=f(x)g(u)

Where

f(x)=1xg(u)=uu1

Integrating gives

1g(u)du=f(x)dxu1udu=1xdx
u(x)+ln(1u(x))=ln(x)+c1

Converting u(x)+ln(1u(x))=ln(x)+c1 back to y gives

yx+ln(xy)=ln(x)+c1

Solving for y gives

y=c1x+ln(x)xln(1LambertW(ec1x))x
Figure 2.51: Slope field y=y2x(x+y)

Summary of solutions found

y=c1x+ln(x)xln(1LambertW(ec1x))x
Solved using Lie symmetry for first order ode

Time used: 0.567 (sec)

Writing the ode as

y=y2x(x+y)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 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+y2(b3a2)x(x+y)y4a3x2(x+y)2(y2x2(x+y)+y2x(x+y)2)(xa2+ya3+a1)(2yx(x+y)y2x(x+y)2)(xb2+yb3+b1)=0

Putting the above in normal form gives

x4b2x2y2a2+x2y2b32xy3a3+2x2yb12xy2a1xy2b1+y3a1x2(xy)2=0

Setting the numerator to zero gives

(6E)x4b2x2y2a2+x2y2b32xy3a3+2x2yb12xy2a1xy2b1+y3a1=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)a2v12v222a3v1v23+b2v14+b3v12v222a1v1v22+a1v23+2b1v12v2b1v1v22=0

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

{v1,v2}

Equation (7E) now becomes

(8E)b2v14+(b3a2)v12v22+2b1v12v22a3v1v23+(2a1b1)v1v22+a1v23=0

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

a1=0b2=02a3=02b1=02a1b1=0b3a2=0

Solving the above equations for the unknowns gives

a1=0a2=b3a3=0b1=0b2=0b3=b3

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

ξ=xη=y

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

η=ηω(x,y)ξ=y(y2x(x+y))(x)=yxxyξ=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=1yxxydy

Which results in

S=ln(y)yx

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)=y2x(x+y)

Evaluating all the partial derivatives gives

Rx=1Ry=0Sx=yx2Sy=xyyx

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(y)xyx=c2

Which gives

y=eLambertW(ec2x)+c2

The following diagram shows solution curves of the original ode and how they transform in the canonical coordinates space using the mapping shown.

Original ode in x,y coordinates

Canonical coordinates transformation

ODE in canonical coordinates (R,S)

dydx=y2x(x+y)

dSdR=0

R=xS=ln(y)xyx

Figure 2.52: Slope field y=y2x(x+y)

Summary of solutions found

y=eLambertW(ec2x)+c2
Solved as first order ode of type dAlembert

Time used: 36.493 (sec)

Let p=y the ode becomes

p=y2x(x+y)

Solving for y from the above results in

(1)y=(p2+p24p2)x(2)y=(p2p24p2)x

This has the form

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

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

Solving ode 1A

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=p2+p(p4)2g=0

Hence (2) becomes

(2A)p2p(p4)2=(x2+xp2p24pxp24p)p(x)

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

p2p(p4)2=0

Solving the above for p results in

p1=0

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

y=0

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

(3)p(x)=p(x)2p(x)(p(x)4)2x2+xp(x)2p(x)24p(x)xp(x)24p(x)

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

The ode

(5)p(x)=(p(x)p(x)(p(x)4))p(x)(p(x)4)x(p(x)(p(x)4)+p(x)2)

is separable as it can be written as

p(x)=(p(x)p(x)(p(x)4))p(x)(p(x)4)x(p(x)(p(x)4)+p(x)2)=f(x)g(p)

Where

f(x)=1xg(p)=(pp(p4))p(p4)p(p4)+p2

Integrating gives

1g(p)dp=f(x)dxp(p4)+p2(pp(p4))p(p4)dp=1xdx
ln(1p(x)(p(x)4)+p(x)2p(x))+p(x)2+p(x)(p(x)4)2=ln(x)+c1

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

y=x(LambertW(2ec12x)22(LambertW(2ec12x)+1)+LambertW(2ec12x)2(LambertW(2ec12x)2LambertW(2ec12x)+14)LambertW(2ec12x)+12)

Solving ode 2A

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=p2p(p4)2g=0

Hence (2) becomes

(2A)p2+p(p4)2=(x2xp2p24p+xp24p)p(x)

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

p2+p(p4)2=0

Solving the above for p results in

p1=0

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

y=0

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

(3)p(x)=p(x)2+p(x)(p(x)4)2x2xp(x)2p(x)24p(x)+xp(x)24p(x)

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

The ode

(6)p(x)=(p(x)+p(x)(p(x)4))p(x)(p(x)4)x(p(x)(p(x)4)p(x)+2)

is separable as it can be written as

p(x)=(p(x)+p(x)(p(x)4))p(x)(p(x)4)x(p(x)(p(x)4)p(x)+2)=f(x)g(p)

Where

f(x)=1xg(p)=(p+p(p4))p(p4)p(p4)p+2

Integrating gives

1g(p)dp=f(x)dxp(p4)p+2(p+p(p4))p(p4)dp=1xdx
ln(p(x)(p(x)4)+p(x)2p(x))+p(x)2p(x)(p(x)4)2=ln(x)+c2

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

y=x(2LambertW(2ec2x)ln(1LambertW(2ec2x))+LambertW(2ec2x)ln(2)2ln(x)LambertW(2ec2x)2c2LambertW(2ec2x)2LambertW(2ec2x)+2ln(1LambertW(2ec2x))+ln(2)2ln(x)2c24(LambertW(2ec2x)+1)(2LambertW(2ec2x)ln(1LambertW(2ec2x))+LambertW(2ec2x)ln(2)2ln(x)LambertW(2ec2x)2c2LambertW(2ec2x)2LambertW(2ec2x)+2ln(1LambertW(2ec2x))+ln(2)2ln(x)2c2)(2LambertW(2ec2x)ln(1LambertW(2ec2x))+LambertW(2ec2x)ln(2)2ln(x)LambertW(2ec2x)2c2LambertW(2ec2x)2LambertW(2ec2x)+2ln(1LambertW(2ec2x))+ln(2)2ln(x)2c22(LambertW(2ec2x)+1)4)2(LambertW(2ec2x)+1)2)

The solution

y=x(2LambertW(2ec2x)ln(1LambertW(2ec2x))+LambertW(2ec2x)ln(2)2ln(x)LambertW(2ec2x)2c2LambertW(2ec2x)2LambertW(2ec2x)+2ln(1LambertW(2ec2x))+ln(2)2ln(x)2c24(LambertW(2ec2x)+1)(2LambertW(2ec2x)ln(1LambertW(2ec2x))+LambertW(2ec2x)ln(2)2ln(x)LambertW(2ec2x)2c2LambertW(2ec2x)2LambertW(2ec2x)+2ln(1LambertW(2ec2x))+ln(2)2ln(x)2c2)(2LambertW(2ec2x)ln(1LambertW(2ec2x))+LambertW(2ec2x)ln(2)2ln(x)LambertW(2ec2x)2c2LambertW(2ec2x)2LambertW(2ec2x)+2ln(1LambertW(2ec2x))+ln(2)2ln(x)2c22(LambertW(2ec2x)+1)4)2(LambertW(2ec2x)+1)2)

was found not to satisfy the ode or the IC. Hence it is removed.

Figure 2.53: Slope field y=y2x(x+y)

Summary of solutions found

y=0y=x(LambertW(2ec12x)22(LambertW(2ec12x)+1)+LambertW(2ec12x)2(LambertW(2ec12x)2LambertW(2ec12x)+14)LambertW(2ec12x)+12)
Maple. Time used: 0.026 (sec). Leaf size: 17
ode:=x^2*diff(y(x),x)+y(x)^2 = x*y(x)*diff(y(x),x); 
dsolve(ode,y(x), singsol=all);
 
y=xLambertW(ec1x)

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 D 
<- homogeneous successful`
 

Maple step by step

Let’s solvex2(ddxy(x))+y(x)2=xy(x)(ddxy(x))Highest derivative means the order of the ODE is1ddxy(x)Solve for the highest derivativeddxy(x)=y(x)2xy(x)+x2
Mathematica. Time used: 2.159 (sec). Leaf size: 25
ode=x^2*D[y[x],x]+y[x]^2==x*y[x]*D[y[x],x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)xW(ec1x)y(x)0
Sympy. Time used: 0.433 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x**2*Derivative(y(x), x) - x*y(x)*Derivative(y(x), x) + y(x)**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
y(x)=xW(C1x)