2.1.5 Problem 5

Solved using first_order_ode_poly
Solved using first_order_ode_homog_type_maple_C
Solved using first_order_ode_exact
Solved using first_order_ode_LIE
Solved using first_order_ode_dAlembert
Maple
Mathematica
Sympy

Internal problem ID [4081]
Book : Differential equations, Shepley L. Ross, 1964
Section : 2.4, page 55
Problem number : 5
Date solved : Friday, April 25, 2025 at 08:57:51 AM
CAS classification : [[_homogeneous, `class C`], _exact, _rational, [_Abel, `2nd type`, `class A`]]

Solved using first_order_ode_poly

Time used: 0.414 (sec)

Solve

5x+2y+1+(2x+y+1)y=0

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=5,b1=2,c1=1,a2=2,b2=1,c2=1. 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

5x02y01=02x0+y0+1=0

Solving for x0,y0 from the above gives

x0=1y0=3

Therefore the transformation becomes

X=x1Y=y+3

Using this transformation in 5x+2y+1+(2x+y+1)y=0 result in

dYdX=2Y5X2X+Y

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)=2Y+5X2X+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=2Y5X and N=2X+Y 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=2u5u+2dudX=2u(X)5u(X)+2u(X)X

Or

ddXu(X)2u(X)5u(X)+2u(X)X=0

Or

(ddXu(X))Xu(X)+u(X)2+2(ddXu(X))X+4u(X)+5=0

Or

X(u(X)+2)(ddXu(X))+u(X)2+4u(X)+5=0

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

The ode

(1)ddXu(X)=u(X)2+4u(X)+5X(u(X)+2)

is separable as it can be written as

ddXu(X)=u(X)2+4u(X)+5X(u(X)+2)=f(X)g(u)

Where

f(X)=1Xg(u)=u2+4u+5u+2

Integrating gives

1g(u)du=f(X)dXu+2u2+4u+5du=1XdX
ln(u(X)2+4u(X)+5)2=ln(1X)+c2

Taking the exponential of both sides the solution becomes

u(X)2+4u(X)+5=c2X

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

u2+4u+5u+2=0

for u(X) gives

u(X)=2iu(X)=2+i

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

u(X)2+4u(X)+5=c2Xu(X)=2iu(X)=2+i

Converting u(X)2+4u(X)+5=c2X back to Y(X) gives

Y(X)2+4Y(X)X+5X2X2=c2X

Converting u(X)=2i back to Y(X) gives

Y(X)=(2i)X

Converting u(X)=2+i back to Y(X) gives

Y(X)=(2+i)X

The solution is implicit Y(X)2+4Y(X)X+5X2X2=c2X. Replacing Y=yy0,X=xx0 gives

5(x1)2+4(y+3)(x1)+(y+3)2(x1)2=c2x1

The solution is

Y(X)=(2i)X

Replacing Y=yy0,X=xx0 gives

y+3=(2i)(x1)

Or

y=(2i)(x1)3

Which simplifies to

y=1+i+(2i)x

The solution is

Y(X)=(2+i)X

Replacing Y=yy0,X=xx0 gives

y+3=(2+i)(x1)

Or

y=(2+i)(x1)3

Which simplifies to

y=1i+(2+i)x

Solving for y gives

y=1i+(2+i)xy=1+i+(2i)xy=2x1x2+c2+2x1y=2x1+x2+c2+2x1
Figure 2.6: Slope field 5x+2y+1+(2x+y+1)y=0

Summary of solutions found

y=1i+(2+i)xy=1+i+(2i)xy=2x1x2+c2+2x1y=2x1+x2+c2+2x1
Solved using first_order_ode_homog_type_maple_C

Time used: 0.333 (sec)

Solve

5x+2y+1+(2x+y+1)y=0

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

ddXY(X)=2Y(X)+2y0+5X+5x0+12X+2x0+Y(X)+y0+1

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

x0=1y0=3

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

ddXY(X)=2Y(X)+5X2X+Y(X)

In canonical form, the ODE is

Y=F(X,Y)(1)=2Y+5X2X+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=2Y5X and N=2X+Y 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=2u5u+2dudX=2u(X)5u(X)+2u(X)X

Or

ddXu(X)2u(X)5u(X)+2u(X)X=0

Or

(ddXu(X))Xu(X)+u(X)2+2(ddXu(X))X+4u(X)+5=0

Or

X(u(X)+2)(ddXu(X))+u(X)2+4u(X)+5=0

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

The ode

(2)ddXu(X)=u(X)2+4u(X)+5X(u(X)+2)

is separable as it can be written as

ddXu(X)=u(X)2+4u(X)+5X(u(X)+2)=f(X)g(u)

Where

f(X)=1Xg(u)=u2+4u+5u+2

Integrating gives

1g(u)du=f(X)dXu+2u2+4u+5du=1XdX
ln(u(X)2+4u(X)+5)2=ln(1X)+c3

Taking the exponential of both sides the solution becomes

u(X)2+4u(X)+5=c3X

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

u2+4u+5u+2=0

for u(X) gives

u(X)=2iu(X)=2+i

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

u(X)2+4u(X)+5=c3Xu(X)=2iu(X)=2+i

Converting u(X)2+4u(X)+5=c3X back to Y(X) gives

Y(X)2+4Y(X)X+5X2X2=c3X

Converting u(X)=2i back to Y(X) gives

Y(X)=(2i)X

Converting u(X)=2+i back to Y(X) gives

Y(X)=(2+i)X

Using the solution for Y(X)

(A)Y(X)2+4Y(X)X+5X2X2=c3X

And replacing back terms in the above solution using

Y=y+y0X=x0+x

Or

Y=y3X=x+1

Then the solution in y becomes using EQ (A)

5(x1)2+4(y+3)(x1)+(y+3)2(x1)2=c3x1

Using the solution for Y(X)

(A)Y(X)=(2i)X

And replacing back terms in the above solution using

Y=y+y0X=x0+x

Or

Y=y3X=x+1

Then the solution in y becomes using EQ (A)

y+3=(2i)(x1)

Using the solution for Y(X)

(A)Y(X)=(2+i)X

And replacing back terms in the above solution using

Y=y+y0X=x0+x

Or

Y=y3X=x+1

Then the solution in y becomes using EQ (A)

y+3=(2+i)(x1)

Solving for y gives

y=2x1x2+c3+2x1y=2x1+x2+c3+2x1y=ix2x+i1y=ix2xi1

Which simplifies to

y=2x1x2+c3+2x1y=2x1+x2+c3+2x1y=1+i+(2i)xy=1i+(2+i)x
Figure 2.7: Slope field 5x+2y+1+(2x+y+1)y=0

Summary of solutions found

y=2x1x2+c3+2x1y=2x1+x2+c3+2x1y=1+i+(2i)xy=1i+(2+i)x
Solved using first_order_ode_exact

Time used: 0.068 (sec)

Solve

5x+2y+1+(2x+y+1)y=0

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

(2x+y+1)dy=(2y5x1)dx(2A)(2y+5x+1)dx+(2x+y+1)dy=0

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

M(x,y)=2y+5x+1N(x,y)=2x+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(2y+5x+1)=2

And

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

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=2y+5x+1dx(3)ϕ=x(4y+5x+2)2+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=2x+f(y)

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

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

Solving equation (5) for f(y) gives

f(y)=y+1

Integrating the above w.r.t y gives

f(y)dy=(y+1)dyf(y)=12y2+y+c4

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

ϕ=x(4y+5x+2)2+y22+y+c4

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

c4=x(4y+5x+2)2+y22+y

Solving for y gives

y=2x1x2+2c4+2x+1y=2x1+x2+2c4+2x+1
Figure 2.8: Slope field 5x+2y+1+(2x+y+1)y=0

Summary of solutions found

y=2x1x2+2c4+2x+1y=2x1+x2+2c4+2x+1
Solved using first_order_ode_LIE

Time used: 0.326 (sec)

Solve

5x+2y+1+(2x+y+1)y=0

Writing the ode as

y=2y+5x+12x+y+1y=ω(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(2y+5x+1)(b3a2)2x+y+1(2y+5x+1)2a3(2x+y+1)2(52x+y+1+4y+10x+2(2x+y+1)2)(xa2+ya3+a1)(22x+y+1+2y+5x+1(2x+y+1)2)(xb2+yb3+b1)=0

Putting the above in normal form gives

10x2a225x2a3+3x2b210x2b3+10xya220xya3+4xyb210xyb3+2y2a23y2a3+y2b22y2b3+10xa210xa3xb1+5xb27xb3+ya1+3ya2ya3+2yb22yb3+3a1+a2a3+b1+b2b3(2x+y+1)2=0

Setting the numerator to zero gives

(6E)10x2a225x2a3+3x2b210x2b3+10xya220xya3+4xyb210xyb3+2y2a23y2a3+y2b22y2b3+10xa210xa3xb1+5xb27xb3+ya1+3ya2ya3+2yb22yb3+3a1+a2a3+b1+b2b3=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)10a2v12+10a2v1v2+2a2v2225a3v1220a3v1v23a3v22+3b2v12+4b2v1v2+b2v2210b3v1210b3v1v22b3v22+a1v2+10a2v1+3a2v210a3v1a3v2b1v1+5b2v1+2b2v27b3v12b3v2+3a1+a2a3+b1+b2b3=0

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

{v1,v2}

Equation (7E) now becomes

(8E)(10a225a3+3b210b3)v12+(10a220a3+4b210b3)v1v2+(10a210a3b1+5b27b3)v1+(2a23a3+b22b3)v22+(a1+3a2a3+2b22b3)v2+3a1+a2a3+b1+b2b3=0

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

2a23a3+b22b3=010a225a3+3b210b3=010a220a3+4b210b3=0a1+3a2a3+2b22b3=010a210a3b1+5b27b3=03a1+a2a3+b1+b2b3=0

Solving the above equations for the unknowns gives

a1=a3b3a2=4a3+b3a3=a3b1=5a3+3b3b2=5a3b3=b3

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

ξ=x1η=3+y

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

η=ηω(x,y)ξ=3+y(2y+5x+12x+y+1)(x1)=5x2+4xy+y2+2x+2y+22x+y+1ξ=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=15x2+4xy+y2+2x+2y+22x+y+1dy

Which results in

S=ln(5x2+4xy+y2+2x+2y+2)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)=2y+5x+12x+y+1

Evaluating all the partial derivatives gives

Rx=1Ry=0Sx=2y+5x+15x2+(4y+2)x+y2+2y+2Sy=2x+y+1y2+(4x+2)y+5x2+2x+2

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+c7S(R)=c7

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

ln(5x2+(4y+2)x+y2+2y+2)2=c7

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=2y+5x+12x+y+1

dSdR=0

R=xS=ln(5x2+(4y+2)x+y2+2y+2)2

Solving for y gives

y=2x1x2+e2c7+2x1y=2x1+x2+e2c7+2x1
Figure 2.9: Slope field 5x+2y+1+(2x+y+1)y=0

Summary of solutions found

y=2x1x2+e2c7+2x1y=2x1+x2+e2c7+2x1
Solved using first_order_ode_dAlembert

Time used: 0.191 (sec)

Solve

5x+2y+1+(2x+y+1)y=0

Let p=y the ode becomes

5x+2y+1+(2x+y+1)p=0

Solving for y from the above results in

(1)y=(2p+5)x2+pp+12+p

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=2p52+pg=p12+p

Hence (2) becomes

(2A)p2p52+p=(2x2+p+2xp(2+p)2+5x(2+p)212+p+p(2+p)2+1(2+p)2)p(x)

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

p2p52+p=0

Solving the above for p results in

p1=2+ip2=2i

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

y=1i+(2+i)xy=1+i+(2i)x

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

(3)p(x)=p(x)2p(x)52+p(x)2x2+p(x)+2xp(x)(2+p(x))2+5x(2+p(x))212+p(x)+p(x)(2+p(x))2+1(2+p(x))2

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

The ode

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

is separable as it can be written as

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

Where

f(x)=1x1g(p)=(2+p)(p2+4p+5)

Integrating gives

1g(p)dp=f(x)dx1(2+p)(p2+4p+5)dp=1x1dx
ln(2+p(x)p(x)2+4p(x)+5)=ln(x1)+c8

Taking the exponential of both sides the solution becomes

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

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

(2+p)(p2+4p+5)=0

for p(x) gives

p(x)=2p(x)=2ip(x)=2+i

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

2+p(x)p(x)2+4p(x)+5=c8(x1)p(x)=2p(x)=2ip(x)=2+i

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

y=x(2c81c82x22c82x+c821x+2c81c82x22c82x+c8211)c81c82x22c82x+c821xc81c82x22c82x+c821+c81c82x22c82x+c821x+c81c82x22c82x+c821+1c81c82x22c82x+c821xc81c82x22c82x+c821y=(25i5)(5x+13i)y=(25+i5)(5x+1+3i)

Which simplifies to

y=1+i+(2i)xy=1i+(2+i)xy=1i+(2+i)xy=1+i+(2i)xy=1+11+c82(x1)2(2x+1)c811+c82(x1)2c8
Figure 2.10: Slope field 5x+2y+1+(2x+y+1)y=0

Summary of solutions found

y=1+i+(2i)xy=1i+(2+i)xy=1i+(2+i)xy=1+i+(2i)xy=1+11+c82(x1)2(2x+1)c811+c82(x1)2c8
Maple. Time used: 0.129 (sec). Leaf size: 32
ode:=5*x+2*y(x)+1+(2*x+y(x)+1)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
y=(x1)2c12+1+(2x1)c1c1

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 solve5x+2y(x)+1+(2x+y(x)+1)(ddxy(x))=0Highest derivative means the order of the ODE is1ddxy(x)Check if ODE is exactODE is exact if the lhs is the total derivative of aC2functionddxG(x,y(x))=0Compute derivative of lhsxG(x,y)+(yG(x,y))(ddxy(x))=0Evaluate derivatives2=2Condition met, ODE is exactExact ODE implies solution will be of this form[G(x,y)=C1,M(x,y)=xG(x,y),N(x,y)=yG(x,y)]Solve forG(x,y)by integratingM(x,y)with respect toxG(x,y)=(5x+2y+1)dx+_F1(y)Evaluate integralG(x,y)=5x22+2yx+x+_F1(y)Take derivative ofG(x,y)with respect toyN(x,y)=yG(x,y)Compute derivative2x+y+1=2x+ddy_F1(y)Isolate forddy_F1(y)ddy_F1(y)=y+1Solve for_F1(y)_F1(y)=12y2+ySubstitute_F1(y)into equation forG(x,y)G(x,y)=52x2+2yx+x+12y2+ySubstituteG(x,y)into the solution of the ODE52x2+2yx+x+12y2+y=C1Solve fory(x){y(x)=2x1x2+2C1+2x+1,y(x)=2x1+x2+2C1+2x+1}
Mathematica. Time used: 0.154 (sec). Leaf size: 53
ode=(5*x+2*y[x]+1)+(2*x+y[x]+1)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)x2+2x+1+c12x1y(x)x2+2x+1+c12x1
Sympy. Time used: 1.954 (sec). Leaf size: 39
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(5*x + (2*x + y(x) + 1)*Derivative(y(x), x) + 2*y(x) + 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
[y(x)=2xC1x2+2x1, y(x)=2x+C1x2+2x1]