2.4.3 Problem 3

Solved using first_order_ode_bernoulli
Solved using first_order_ode_exact
Maple
Mathematica
Sympy

Internal problem ID [18483]
Book : Elementary Differential Equations. By Thornton C. Fry. D Van Nostrand. NY. First Edition (1929)
Section : Chapter IV. Methods of solution: First order equations. section 31. Problems at page 85
Problem number : 3
Date solved : Monday, March 31, 2025 at 05:36:29 PM
CAS classification : [_Bernoulli]

Solved using first_order_ode_bernoulli

Time used: 0.165 (sec)

Solve

y+yx=sin(x)y3

In canonical form, the ODE is

y=F(x,y)=y4+sin(x)xxy3

This is a Bernoulli ODE.

(1)y=(1x)y+(sin(x))1y3

The standard Bernoulli ODE has the form

(2)y=f0(x)y+f1(x)yn

Comparing this to (1) shows that

f0=1xf1=sin(x)

The first step is to divide the above equation by yn which gives

(3)yyn=f0(x)y1n+f1(x)

The next step is use the substitution v=y1n in equation (3) which generates a new ODE in v(x) which will be linear and can be easily solved using an integrating factor. Backsubstitution then gives the solution y(x) which is what we want.

This method is now applied to the ODE at hand. Comparing the ODE (1) With (2) Shows that

f0(x)=1xf1(x)=sin(x)n=3

Dividing both sides of ODE (1) by yn=1y3 gives

(4)yy3=y4x+sin(x)

Let

v=y1n(5)=y4

Taking derivative of equation (5) w.r.t x gives

(6)v=4y3y

Substituting equations (5) and (6) into equation (4) gives

v(x)4=v(x)x+sin(x)(7)v=4vx+4sin(x)

The above now is a linear ODE in v(x) which is now solved.

In canonical form a linear first order is

v(x)+q(x)v(x)=p(x)

Comparing the above to the given ode shows that

q(x)=4xp(x)=4sin(x)

The integrating factor μ is

μ=eqdx=e4xdx=x4

The ode becomes

ddx(μv)=μpddx(μv)=(μ)(4sin(x))ddx(vx4)=(x4)(4sin(x))d(vx4)=(4sin(x)x4)dx

Integrating gives

vx4=4sin(x)x4dx=(4x4+48x296)cos(x)+16sin(x)x(x26)+c1

Dividing throughout by the integrating factor x4 gives the final solution

v(x)=4(x4+12x224)cos(x)+16(x36x)sin(x)+c1x4

The substitution v=y1n is now used to convert the above solution back to y which results in

y4=4(x4+12x224)cos(x)+16(x36x)sin(x)+c1x4

Solving for y gives

y=(4cos(x)x4+16sin(x)x3+48cos(x)x296sin(x)x96cos(x)+c1)1/4xy=i(4cos(x)x4+16sin(x)x3+48cos(x)x296sin(x)x96cos(x)+c1)1/4xy=i(4cos(x)x4+16sin(x)x3+48cos(x)x296sin(x)x96cos(x)+c1)1/4xy=(4cos(x)x4+16sin(x)x3+48cos(x)x296sin(x)x96cos(x)+c1)1/4x

Which simplifies to

y=(4(x4+12x224)cos(x)+16(x36x)sin(x)+c1)1/4xy=i(4(x4+12x224)cos(x)+16(x36x)sin(x)+c1)1/4xy=i(4(x4+12x224)cos(x)+16(x36x)sin(x)+c1)1/4xy=(4(x4+12x224)cos(x)+16(x36x)sin(x)+c1)1/4x
Figure 2.44: Slope field y+yx=sin(x)y3

Summary of solutions found

y=(4(x4+12x224)cos(x)+16(x36x)sin(x)+c1)1/4xy=i(4(x4+12x224)cos(x)+16(x36x)sin(x)+c1)1/4xy=i(4(x4+12x224)cos(x)+16(x36x)sin(x)+c1)1/4xy=(4(x4+12x224)cos(x)+16(x36x)sin(x)+c1)1/4x
Solved using first_order_ode_exact

Time used: 0.151 (sec)

Solve

y+yx=sin(x)y3

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

(xy3)dy=(y4+sin(x)x)dx(2A)(y4sin(x)x)dx+(xy3)dy=0

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

M(x,y)=y4sin(x)xN(x,y)=xy3

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(y4sin(x)x)=4y3

And

Nx=x(xy3)=y3

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)=1xy3((4y3)(y3))=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(y4sin(x)x)=(y4sin(x)x)x3

And

N=μN=x3(xy3)=x4y3

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

M+Ndydx=0((y4sin(x)x)x3)+(x4y3)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=(y4sin(x)x)x3dx(3)ϕ=(x412x2+24)cos(x)+4(x3+6x)sin(x)+y4x44+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=x4y3+f(y)

But equation (2) says that ϕy=x4y3. Therefore equation (4) becomes

(5)x4y3=x4y3+f(y)

Solving equation (5) for f(y) gives

f(y)=0

Therefore

f(y)=c2

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

ϕ=(x412x2+24)cos(x)+4(x3+6x)sin(x)+y4x44+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=(x412x2+24)cos(x)+4(x3+6x)sin(x)+y4x44

Solving for y gives

y=(4cos(x)x4+16sin(x)x3+48cos(x)x296sin(x)x+4c296cos(x))1/4xy=i(4cos(x)x4+16sin(x)x3+48cos(x)x296sin(x)x+4c296cos(x))1/4xy=i(4cos(x)x4+16sin(x)x3+48cos(x)x296sin(x)x+4c296cos(x))1/4xy=(4cos(x)x4+16sin(x)x3+48cos(x)x296sin(x)x+4c296cos(x))1/4x

Which simplifies to

y=2((x4+12x224)cos(x)+4(x36x)sin(x)+c2)1/4xy=i2((x4+12x224)cos(x)+4(x36x)sin(x)+c2)1/4xy=i2((x4+12x224)cos(x)+4(x36x)sin(x)+c2)1/4xy=2((x4+12x224)cos(x)+4(x36x)sin(x)+c2)1/4x
Figure 2.45: Slope field y+yx=sin(x)y3

Summary of solutions found

y=2((x4+12x224)cos(x)+4(x36x)sin(x)+c2)1/4xy=i2((x4+12x224)cos(x)+4(x36x)sin(x)+c2)1/4xy=i2((x4+12x224)cos(x)+4(x36x)sin(x)+c2)1/4xy=2((x4+12x224)cos(x)+4(x36x)sin(x)+c2)1/4x
Maple. Time used: 0.019 (sec). Leaf size: 156
ode:=diff(y(x),x)+y(x)/x = sin(x)/y(x)^3; 
dsolve(ode,y(x), singsol=all);
 
y=(4(x4+12x224)cos(x)+16(x36x)sin(x)+c1)1/4xy=(4(x4+12x224)cos(x)+16(x36x)sin(x)+c1)1/4xy=i(4(x4+12x224)cos(x)+16(x36x)sin(x)+c1)1/4xy=i(4(x4+12x224)cos(x)+16(x36x)sin(x)+c1)1/4x

Maple trace

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

Maple step by step

Let’s solveddxy(x)+y(x)x=sin(x)y(x)3Highest derivative means the order of the ODE is1ddxy(x)Solve for the highest derivativeddxy(x)=y(x)x+sin(x)y(x)3
Mathematica. Time used: 0.476 (sec). Leaf size: 114
ode=D[y[x],x]+y[x]/x==Sin[x]/y[x]^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)9(x22)sin(x)3x(x26)cos(x)+c13xy(x)139(x22)sin(x)3x(x26)cos(x)+c13xy(x)(1)2/39(x22)sin(x)3x(x26)cos(x)+c13x
Sympy. Time used: 4.540 (sec). Leaf size: 197
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - sin(x)/y(x)**3 + y(x)/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
[y(x)=iC1x44cos(x)+16sin(x)x+48cos(x)x296sin(x)x396cos(x)x44, y(x)=iC1x44cos(x)+16sin(x)x+48cos(x)x296sin(x)x396cos(x)x44, y(x)=C1x44cos(x)+16sin(x)x+48cos(x)x296sin(x)x396cos(x)x44, y(x)=C1x44cos(x)+16sin(x)x+48cos(x)x296sin(x)x396cos(x)x44]