2.1.37 Problem 37

Solved using first_order_ode_quadrature
Solved using first_order_ode_exact
Maple
Mathematica
Sympy

Internal problem ID [9021]
Book : First order enumerated odes
Section : section 1
Problem number : 37
Date solved : Sunday, March 30, 2025 at 01:59:26 PM
CAS classification : [_quadrature]

Solved using first_order_ode_quadrature

Time used: 0.036 (sec)

Solve

xy=1

Since the ode has the form y=f(x), then we only need to integrate f(x).

dy=1xdxy=ln(x)+c1
Figure 2.41: Slope field xy=1

Summary of solutions found

y=ln(x)+c1
Solved using first_order_ode_exact

Time used: 0.058 (sec)

Solve

xy=1

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)dy=dx(2A)dx+(x)dy=0

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

M(x,y)=1N(x,y)=x

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

And

Nx=x(x)=1

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((0)(1))=1x

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

μ=eAdx=e1xdx

The result of integrating gives

μ=eln(x)=1x

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

And

N=μN=1x(x)=1

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

M+Ndydx=0(1x)+(1)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=1xdx(3)ϕ=ln(x)+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=1. Therefore equation (4) becomes

(5)1=0+f(y)

Solving equation (5) for f(y) gives

f(y)=1

Integrating the above w.r.t y gives

f(y)dy=(1)dyf(y)=y+c2

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

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

Solving for y gives

y=c2+ln(x)
Figure 2.42: Slope field xy=1

Summary of solutions found

y=c2+ln(x)
Maple. Time used: 0.001 (sec). Leaf size: 8
ode:=diff(y(x),x)*x = 1; 
dsolve(ode,y(x), singsol=all);
 
y=ln(x)+c1

Maple trace

Methods for first order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
<- quadrature successful
 

Maple step by step

Let’s solvex(ddxy(x))=1Highest derivative means the order of the ODE is1ddxy(x)Solve for the highest derivativeddxy(x)=1xIntegrate both sides with respect tox(ddxy(x))dx=1xdx+C1Evaluate integraly(x)=ln(x)+C1
Mathematica. Time used: 0.002 (sec). Leaf size: 10
ode=x*D[y[x],x]==1; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)log(x)+c1
Sympy. Time used: 0.184 (sec). Leaf size: 7
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
y(x)=C1+log(x)