2.8.2 Problem 2

Solved as second order linear constant coeff ode
Solved as second order can be made integrable
Solved as second order ode using Kovacic algorithm
Maple
Mathematica
Sympy

Internal problem ID [18510]
Book : Elementary Differential Equations. By Thornton C. Fry. D Van Nostrand. NY. First Edition (1929)
Section : Chapter VII. Linear equations of order higher than the first. section 56. Problems at page 163
Problem number : 2
Date solved : Monday, March 31, 2025 at 05:40:50 PM
CAS classification : [[_2nd_order, _missing_x]]

Solved as second order linear constant coeff ode

Time used: 0.060 (sec)

Solve

y+y=0

This is second order with constant coefficients homogeneous ODE. In standard form the ODE is

Ay(x)+By(x)+Cy(x)=0

Where in the above A=1,B=0,C=1. Let the solution be y=eλx. Substituting this into the ODE gives

(1)λ2exλ+exλ=0

Since exponential function is never zero, then dividing Eq(2) throughout by eλx gives

(2)λ2+1=0

Equation (2) is the characteristic equation of the ODE. Its roots determine the general solution form.Using the quadratic formula

λ1,2=B2A±12AB24AC

Substituting A=1,B=0,C=1 into the above gives

λ1,2=0(2)(1)±1(2)(1)02(4)(1)(1)=±i

Hence

λ1=+iλ2=i

Which simplifies to

λ1=iλ2=i

Since roots are complex conjugate of each others, then let the roots be

λ1,2=α±iβ

Where α=0 and β=1. Therefore the final solution, when using Euler relation, can be written as

y=eαx(c1cos(βx)+c2sin(βx))

Which becomes

y=e0(c1cos(x)+c2sin(x))

Or

y=c1cos(x)+c2sin(x)

Will add steps showing solving for IC soon.

Summary of solutions found

y=c1cos(x)+c2sin(x)
Figure 2.83: Slope field y+y=0
Solved as second order can be made integrable

Time used: 1.052 (sec)

Solve

y+y=0

Multiplying the ode by y gives

yy+yy=0

Integrating the above w.r.t x gives

(yy+yy)dx=0y22+y22=c1

Which is now solved for y. Let p=y the ode becomes

p22+y22=c1

Solving for y from the above results in

(1)y=p2+2c1(2)y=p2+2c1

This has the form

(*)y=xf(p)+g(p)

Where f,g are functions of p=y(x). Each of the above ode’s is dAlembert ode which is now solved.

Solving ode 1A

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=p2+2c1

Hence (2) becomes

(2A)p=pp(x)p2+2c1

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=2c1

The general solution is found when dpdx0. From eq. (2A). This results in

(3)p(x)=p(x)2+2c1

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

Integrating gives

1p2+2c1dp=dxarctan(pp2+2c1)=x+c2

Singular solutions are found by solving

p2+2c1=0

for p(x). This is because we had to divide by this in the above step. This gives the following singular solution(s), which also have to satisfy the given ODE.

p(x)=2c1p(x)=2c1

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

y=2tan(x+c2)2c1tan(x+c2)2+1+2c1y=0y=0

Solving ode 2A

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=p2+2c1

Hence (2) becomes

(2A)p=pp(x)p2+2c1

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=2c1

The general solution is found when dpdx0. From eq. (2A). This results in

(3)p(x)=p(x)2+2c1

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

Integrating gives

1p2+2c1dp=dxarctan(pp2+2c1)=x+c3

Singular solutions are found by solving

p2+2c1=0

for p(x). This is because we had to divide by this in the above step. This gives the following singular solution(s), which also have to satisfy the given ODE.

p(x)=2c1p(x)=2c1

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

y=2tan(x+c3)2c1tan(x+c3)2+1+2c1y=0y=0

Will add steps showing solving for IC soon.

The solution

y=2c1

was found not to satisfy the ode or the IC. Hence it is removed. The solution

y=2c1

was found not to satisfy the ode or the IC. Hence it is removed.

Summary of solutions found

y=0y=2tan(x+c2)2c1tan(x+c2)2+1+2c1y=2tan(x+c3)2c1tan(x+c3)2+1+2c1
Figure 2.84: Slope field y+y=0
Solved as second order ode using Kovacic algorithm

Time used: 0.133 (sec)

Solve

y+y=0

Writing the ode as

(1)y+y=0(2)Ay+By+Cy=0

Comparing (1) and (2) shows that

A=1(3)B=0C=1

Applying the Liouville transformation on the dependent variable gives

z(x)=yeB2Adx

Then (2) becomes

(4)z(x)=rz(x)

Where r is given by

(5)r=st=2AB2BA+B24AC4A2

Substituting the values of A,B,C from (3) in the above and simplifying gives

(6)r=11

Comparing the above to (5) shows that

s=1t=1

Therefore eq. (4) becomes

(7)z(x)=z(x)

Equation (7) is now solved. After finding z(x) then y is found using the inverse transformation

y=z(x)eB2Adx

The first step is to determine the case of Kovacic algorithm this ode belongs to. There are 3 cases depending on the order of poles of r and the order of r at . The following table summarizes these cases.

Case

Allowed pole order for r

Allowed value for O()

1

{0,1,2,4,6,8,}

{,6,4,2,0,2,3,4,5,6,}

2

Need to have at least one pole that is either order 2 or odd order greater than 2. Any other pole order is allowed as long as the above condition is satisfied. Hence the following set of pole orders are all allowed. {1,2},{1,3},{2},{3},{3,4},{1,2,5}.

no condition

3

{1,2}

{2,3,4,5,6,7,}

Table 2.20: Necessary conditions for each Kovacic case

The order of r at is the degree of t minus the degree of s. Therefore

O()=deg(t)deg(s)=00=0

There are no poles in r. Therefore the set of poles Γ is empty. Since there is no odd order pole larger than 2 and the order at is 0 then the necessary conditions for case one are met. Therefore

L=[1]

Since r=1 is not a function of x, then there is no need run Kovacic algorithm to obtain a solution for transformed ode z=rz as one solution is

z1(x)=cos(x)

Using the above, the solution for the original ode can now be found. The first solution to the original ode in y is found from

y1=z1e12BAdx

Since B=0 then the above reduces to

y1=z1=cos(x)

Which simplifies to

y1=cos(x)

The second solution y2 to the original ode is found using reduction of order

y2=y1eBAdxy12dx

Since B=0 then the above becomes

y2=y11y12dx=cos(x)1cos(x)2dx=cos(x)(tan(x))

Therefore the solution is

y=c1y1+c2y2=c1(cos(x))+c2(cos(x)(tan(x)))

Will add steps showing solving for IC soon.

Summary of solutions found

y=c1cos(x)+c2sin(x)
Figure 2.85: Slope field y+y=0
Maple. Time used: 0.001 (sec). Leaf size: 13
ode:=diff(diff(y(x),x),x)+y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
y=c1sin(x)+c2cos(x)

Maple trace

Methods for second order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
checking if the LODE has constant coefficients 
<- constant coefficients successful
 

Maple step by step

Let’s solveddxddxy(x)+y(x)=0Highest derivative means the order of the ODE is2ddxddxy(x)Characteristic polynomial of ODEr2+1=0Use quadratic formula to solve forrr=0±(4)2Roots of the characteristic polynomialr=(I,I)1st solution of the ODEy1(x)=cos(x)2nd solution of the ODEy2(x)=sin(x)General solution of the ODEy(x)=C1y1(x)+C2y2(x)Substitute in solutionsy(x)=C1cos(x)+C2sin(x)
Mathematica. Time used: 0.01 (sec). Leaf size: 16
ode=D[y[x],{x,2}]+y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)c1cos(x)+c2sin(x)
Sympy. Time used: 0.040 (sec). Leaf size: 12
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
y(x)=C1sin(x)+C2cos(x)