2.1.8 Problem 8

Solved using first_order_ode_autonomous
Solved using first_order_ode_homog_type_D2
Solved using first_order_ode_exact
Solved using first_order_ode_dAlembert
Maple
Mathematica
Sympy

Internal problem ID [8719]
Book : Own collection of miscellaneous problems
Section : section 1.0
Problem number : 8
Date solved : Friday, April 25, 2025 at 04:57:49 PM
CAS classification : [_quadrature]

Solved using first_order_ode_autonomous

Time used: 0.051 (sec)

Solve

y=y

Integrating gives

1ydy=1ln(y)=x+c1eln(y)=ex+c1y=c1ex

The following diagram is the phase line diagram. It classifies each of the above equilibrium points as stable or not stable or semi-stable.

Figure 2.18: Slope field y=y

Summary of solutions found

y=0y=c1ex
Solved using first_order_ode_homog_type_D2

Time used: 0.082 (sec)

Solve

y=y

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

u(x)x+u(x)=u(x)x

Which is now solved The ode

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

is separable as it can be written as

u(x)=u(x)(x1)x=f(x)g(u)

Where

f(x)=x1xg(u)=u

Integrating gives

1g(u)du=f(x)dx1udu=x1xdx
ln(u(x))=x+ln(1x)+c2

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

u=0

for u(x) gives

u(x)=0

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

ln(u(x))=x+ln(1x)+c2u(x)=0

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

ln(yx)=x+ln(1x)+c2

Converting u(x)=0 back to y gives

y=0

Solving for y gives

y=0y=ex+c2

Which simplifies to

y=0y=ex+c2
Figure 2.19: Slope field y=y

Summary of solutions found

y=0y=ex+c2
Solved using first_order_ode_exact

Time used: 0.158 (sec)

Solve

y=y

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

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

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

M(x,y)=yN(x,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(y)=1

And

Nx=x(1)=0

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

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

μ=eAdx=e1dx

The result of integrating gives

μ=ex=ex

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=ex(y)=yex

And

N=μN=ex(1)=ex

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

M+Ndydx=0(yex)+(ex)dydx=0

The following equations are now set up to solve for the function ϕ(x,y)

(1)ϕx=M(2)ϕy=N

Integrating (2) w.r.t. y gives

ϕydy=Ndyϕydy=exdy(3)ϕ=yex+f(x)

Where f(x) is used for the constant of integration since ϕ is a function of both x and y. Taking derivative of equation (3) w.r.t x gives

(4)ϕx=yex+f(x)

But equation (1) says that ϕx=yex. Therefore equation (4) becomes

(5)yex=yex+f(x)

Solving equation (5) for f(x) gives

f(x)=0

Therefore

f(x)=c3

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

ϕ=yex+c3

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

c3=yex

Solving for y gives

y=c3ex

Which simplifies to

y=c3ex
Figure 2.20: Slope field y=y

Summary of solutions found

y=c3ex
Solved using first_order_ode_dAlembert

Time used: 0.047 (sec)

Solve

y=y

Let p=y the ode becomes

p=y

Solving for y from the above results in

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

Hence (2) becomes

(2A)p=p(x)

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

p=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)

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

Integrating gives

1pdp=1ln(p)=x+c5eln(y)=ex+c5p(x)=c5ex

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

y=c5exy=0
Figure 2.21: Slope field y=y

Summary of solutions found

y=0y=c5ex
Maple. Time used: 0.001 (sec). Leaf size: 8
ode:=diff(y(x),x) = y(x); 
dsolve(ode,y(x), singsol=all);
 
y=c1ex

Maple trace

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

Maple step by step

Let’s solveddxy(x)=y(x)Highest derivative means the order of the ODE is1ddxy(x)Solve for the highest derivativeddxy(x)=y(x)Separate variablesddxy(x)y(x)=1Integrate both sides with respect toxddxy(x)y(x)dx=1dx+C1Evaluate integralln(y(x))=x+C1Solve fory(x)y(x)=ex+C1Redefine the integration constant(s)y(x)=C1ex
Mathematica. Time used: 0.023 (sec). Leaf size: 16
ode=D[y[x],x] == y[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)c1exy(x)0
Sympy. Time used: 0.036 (sec). Leaf size: 7
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-y(x) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
y(x)=C1ex