2.2.2 Problem 2

Solved as second nonlinear ode solved by Mainardi Lioville method
Maple
Mathematica
Sympy

Internal problem ID [9124]
Book : Second order enumerated odes
Section : section 2
Problem number : 2
Date solved : Friday, April 25, 2025 at 05:54:00 PM
CAS classification : [_Liouville, [_2nd_order, _reducible, _mu_xy]]

Solved as second nonlinear ode solved by Mainardi Lioville method

Time used: 0.365 (sec)

Solve

y+sin(x)y+yy2=0

The ode has the Liouville form given by

(1A)y+f(x)y+g(y)y2=0

Where in this problem

f(x)=sin(x)g(y)=y

Dividing through by y then Eq (1A) becomes

(2A)yy+f+gy=0

But the first term in Eq (2A) can be written as

(3A)yy=ddxln(y)

And the last term in Eq (2A) can be written as

gdydx=(ddygdy)dydx(4A)=ddxgdy

Substituting (3A,4A) back into (2A) gives

(5A)ddxln(y)+ddxgdy=f

Integrating the above w.r.t. x gives

ln(y)+gdy=fdx+c1

Where c1 is arbitrary constant. Taking the exponential of the above gives

(6A)y=c2egdyefdx

Where c2 is a new arbitrary constant. But since g=y and f=sin(x), then

gdy=ydy=y22fdx=sin(x)dx=cos(x)

Substituting the above into Eq(6A) gives

y=c2ey22ecos(x)

Which is now solved as first order separable ode. The ode

(1)y=c2ey22ecos(x)

is separable as it can be written as

y=c2ey22ecos(x)=f(x)g(y)

Where

f(x)=ecos(x)c2g(y)=ey22

Integrating gives

1g(y)dy=f(x)dxey22dy=ecos(x)c2dx
iπ2erf(i2y2)2=ecos(x)c2dx+2c3

Will add steps showing solving for IC soon.

Summary of solutions found

iπ2erf(i2y2)2=ecos(x)c2dx+2c3

Maple. Time used: 0.005 (sec). Leaf size: 35
ode:=diff(diff(y(x),x),x)+diff(y(x),x)*sin(x)+y(x)*diff(y(x),x)^2 = 0; 
dsolve(ode,y(x), singsol=all);
 
y=iRootOf(i2c1ecos(x)dx+i2c2erf(_Z)π)2

Maple trace

Methods for second order ODEs: 
--- Trying classification methods --- 
trying 2nd order Liouville 
<- 2nd_order Liouville successful
 

Mathematica. Time used: 66.642 (sec). Leaf size: 76
ode=D[y[x],{x,2}]+Sin[x]*D[y[x],x]+y[x]*(D[y[x],x])^2==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)i2erf1(i2π(1xecos(K[2])c1dK[2]+c2))y(x)i2erf1(i2πc2)
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x)*Derivative(y(x), x)**2 + sin(x)*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE (sqrt(-4*y(x)*Derivative(y(x), (x, 2)) + sin(x)**2) + sin(x))/(2*y(x)) + Derivative(y(x), x) cannot be solved by the factorable group method