2.1.1 Problem 1

Solved using first_order_ode_exact
Maple
Mathematica
Sympy

Internal problem ID [4077]
Book : Differential equations, Shepley L. Ross, 1964
Section : 2.4, page 55
Problem number : 1
Date solved : Friday, April 25, 2025 at 08:57:39 AM
CAS classification : [_rational, [_Abel, `2nd type`, `class B`]]

Solved using first_order_ode_exact

Time used: 0.179 (sec)

Solve

5xy+4y2+1+(x2+2xy)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

(x2+2xy)dy=(5xy4y21)dx(2A)(5xy+4y2+1)dx+(x2+2xy)dy=0

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

M(x,y)=5xy+4y2+1N(x,y)=x2+2xy

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(5xy+4y2+1)=5x+8y

And

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

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)=1x(x+2y)((5x+8y)(2x+2y))=3x

Since A does not depend on y, then it can be used to find an integrating factor. The integrating factor μ is

μ=eAdx=e3xdx

The result of integrating gives

μ=e3ln(x)=x3

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

M=μM=x3(5xy+4y2+1)=(5xy+4y2+1)x3

And

N=μN=x3(x2+2xy)=x4(x+2y)

Now a modified ODE is ontained from the original ODE, which is exact and can be solved. The modified ODE is

M+Ndydx=0((5xy+4y2+1)x3)+(x4(x+2y))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=(5xy+4y2+1)x3dx(3)ϕ=x5y+x4y2+14x4+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=x5+2yx4+f(y)=x4(x+2y)+f(y)

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

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

Solving equation (5) for f(y) gives

f(y)=0

Therefore

f(y)=c1

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

ϕ=x5y+x4y2+14x4+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=x5y+x4y2+14x4

Solving for y gives

y=x3x6x4+4c12x2y=x3+x6x4+4c12x2
Figure 2.1: Slope field 5xy+4y2+1+(x2+2xy)y=0

Summary of solutions found

y=x3x6x4+4c12x2y=x3+x6x4+4c12x2
Maple. Time used: 0.003 (sec). Leaf size: 59
ode:=5*x*y(x)+4*y(x)^2+1+(x^2+2*x*y(x))*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
y=x3x6x44c12x2y=x3+x6x44c12x2

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 Chini 
differential order: 1; looking for linear symmetries 
trying exact 
<- exact successful
 

Maple step by step

Let’s solve5xy(x)+4y(x)2+1+(x2+2xy(x))(ddxy(x))=0Highest derivative means the order of the ODE is1ddxy(x)Solve for the highest derivativeddxy(x)=5xy(x)4y(x)21x2+2xy(x)
Mathematica. Time used: 0.707 (sec). Leaf size: 84
ode=(5*x*y[x]+4*y[x]^2+1)+(x^2+2*x*y[x])*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)x5+x3x7x5+4c1x2x4y(x)x2+x3x7x5+4c1x2x4
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(5*x*y(x) + (x**2 + 2*x*y(x))*Derivative(y(x), x) + 4*y(x)**2 + 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out