2.3.1 Problem 7 (i)

Existence and uniqueness analysis
Solved as second order linear constant coeff ode
Solved as second order ode using Kovacic algorithm
Maple
Mathematica
Sympy

Internal problem ID [18454]
Book : Elementary Differential Equations. By R.L.E. Schwarzenberger. Chapman and Hall. London. First Edition (1969)
Section : Chapter 5. Linear equations. Exercises at page 85
Problem number : 7 (i)
Date solved : Monday, March 31, 2025 at 05:29:44 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

Existence and uniqueness analysis

Solve

xx=t2

With initial conditions

x(0)=0x(0)=1

This is a linear ODE. In canonical form it is written as

x+p(t)x+q(t)x=F

Where here

p(t)=0q(t)=1F=t2

Hence the ode is

xx=t2

The domain of p(t)=0 is

{<t<}

And the point t0=0 is inside this domain. The domain of q(t)=1 is

{<t<}

And the point t0=0 is also inside this domain. The domain of F=t2 is

{<t<}

And the point t0=0 is also inside this domain. Hence solution exists and is unique.

Solved as second order linear constant coeff ode

Time used: 0.156 (sec)

Solve

xx=t2

With initial conditions

x(0)=0x(0)=1

This is second order non-homogeneous ODE. In standard form the ODE is

Ax(t)+Bx(t)+Cx(t)=f(t)

Where A=1,B=0,C=1,f(t)=t2. Let the solution be

x=xh+xp

Where xh is the solution to the homogeneous ODE Ax(t)+Bx(t)+Cx(t)=0, and xp is a particular solution to the non-homogeneous ODE Ax(t)+Bx(t)+Cx(t)=f(t). xh is the solution to

xx=0

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

Ax(t)+Bx(t)+Cx(t)=0

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

(1)λ2etλetλ=0

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

(2)λ21=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)=±1

Hence

λ1=+1λ2=1

Which simplifies to

λ1=1λ2=1

Since roots are real and distinct, then the solution is

x=c1eλ1t+c2eλ2tx=c1e(1)t+c2e(1)t

Or

x=c1et+c2et

Therefore the homogeneous solution xh is

xh=c1et+c2et

The particular solution is now found using the method of undetermined coefficients. Looking at the RHS of the ode, which is

t2

Shows that the corresponding undetermined set of the basis functions (UC_set) for the trial solution is

[{1,t,t2}]

While the set of the basis functions for the homogeneous solution found earlier is

{et,et}

Since there is no duplication between the basis function in the UC_set and the basis functions of the homogeneous solution, the trial solution is a linear combination of all the basis in the UC_set.

xp=A3t2+A2t+A1

The unknowns {A1,A2,A3} are found by substituting the above trial solution xp into the ODE and comparing coefficients. Substituting the trial solution into the ODE and simplifying gives

A3t2A2tA1+2A3=t2

Solving for the unknowns by comparing coefficients results in

[A1=2,A2=0,A3=1]

Substituting the above back in the above trial solution xp, gives the particular solution

xp=t22

Therefore the general solution is

x=xh+xp=(c1et+c2et)+(t22)

Will add steps showing solving for IC soon.

Summary of solutions found

x=t22+3et2+et2
Solution plot Slope field xx=t2
Solved as second order ode using Kovacic algorithm

Time used: 0.095 (sec)

Solve

xx=t2

With initial conditions

x(0)=0x(0)=1

Writing the ode as

(1)xx=0(2)Ax+Bx+Cx=0

Comparing (1) and (2) shows that

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

Applying the Liouville transformation on the dependent variable gives

z(t)=xeB2Adt

Then (2) becomes

(4)z(t)=rz(t)

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(t)=z(t)

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

x=z(t)eB2Adt

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.18: 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 t, then there is no need run Kovacic algorithm to obtain a solution for transformed ode z=rz as one solution is

z1(t)=et

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

x1=z1e12BAdt

Since B=0 then the above reduces to

x1=z1=et

Which simplifies to

x1=et

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

x2=x1eBAdtx12dt

Since B=0 then the above becomes

x2=x11x12dt=et1e2tdt=et(e2t2)

Therefore the solution is

x=c1x1+c2x2=c1(et)+c2(et(e2t2))

This is second order nonhomogeneous ODE. Let the solution be

x=xh+xp

Where xh is the solution to the homogeneous ODE Ax(t)+Bx(t)+Cx(t)=0, and xp is a particular solution to the nonhomogeneous ODE Ax(t)+Bx(t)+Cx(t)=f(t). xh is the solution to

xx=0

The homogeneous solution is found using the Kovacic algorithm which results in

xh=c1et+c2et2

The particular solution is now found using the method of undetermined coefficients. Looking at the RHS of the ode, which is

t2

Shows that the corresponding undetermined set of the basis functions (UC_set) for the trial solution is

[{1,t,t2}]

While the set of the basis functions for the homogeneous solution found earlier is

{et2,et}

Since there is no duplication between the basis function in the UC_set and the basis functions of the homogeneous solution, the trial solution is a linear combination of all the basis in the UC_set.

xp=A3t2+A2t+A1

The unknowns {A1,A2,A3} are found by substituting the above trial solution xp into the ODE and comparing coefficients. Substituting the trial solution into the ODE and simplifying gives

A3t2A2tA1+2A3=t2

Solving for the unknowns by comparing coefficients results in

[A1=2,A2=0,A3=1]

Substituting the above back in the above trial solution xp, gives the particular solution

xp=t22

Therefore the general solution is

x=xh+xp=(c1et+c2et2)+(t22)

Will add steps showing solving for IC soon.

Summary of solutions found

x=t22+3et2+et2
Solution plot Slope field xx=t2
Maple. Time used: 0.036 (sec). Leaf size: 21
ode:=diff(diff(x(t),t),t)-x(t) = t^2; 
ic:=x(0) = 0, D(x)(0) = 1; 
dsolve([ode,ic],x(t), singsol=all);
 
x=3et2+et2t22

Maple trace

Methods for second order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying high order exact linear fully integrable 
trying differential order: 2; linear nonhomogeneous with symmetry [0,1] 
trying a double symmetry of the form [xi=0, eta=F(x)] 
-> Try solving first the homogeneous part of the ODE 
   checking if the LODE has constant coefficients 
   <- constant coefficients successful 
<- solving first the homogeneous part of the ODE successful
 

Maple step by step

Let’s solve[ddtddtx(t)x(t)=t2,x(0)=0,(ddtx(t))|{t=0}=1]Highest derivative means the order of the ODE is2ddtddtx(t)Characteristic polynomial of homogeneous ODEr21=0Factor the characteristic polynomial(r1)(r+1)=0Roots of the characteristic polynomialr=(1,1)1st solution of the homogeneous ODEx1(t)=et2nd solution of the homogeneous ODEx2(t)=etGeneral solution of the ODEx(t)=C1x1(t)+C2x2(t)+xp(t)Substitute in solutions of the homogeneous ODEx(t)=C1et+C2et+xp(t)Find a particular solutionxp(t)of the ODEUse variation of parameters to findxpheref(t)is the forcing function[xp(t)=x1(t)x2(t)f(t)W(x1(t),x2(t))dt+x2(t)x1(t)f(t)W(x1(t),x2(t))dt,f(t)=t2]Wronskian of solutions of the homogeneous equationW(x1(t),x2(t))=[etetetet]Compute WronskianW(x1(t),x2(t))=2Substitute functions into equation forxp(t)xp(t)=etett2dt2+etett2dt2Compute integralsxp(t)=t22Substitute particular solution into general solution to ODEx(t)=C1et+C2ett22Check validity of solutionx(t)=_C1et+_C2ett22Use initial conditionx(0)=00=_C1+_C22Compute derivative of the solutionddtx(t)=_C1et+_C2et2tUse the initial condition(ddtx(t))|{t=0}=11=_C1+_C2Solve for_C1and_C2{_C1=12,_C2=32}Substitute constant values into general solution and simplifyx(t)=et2+3et2t22Solution to the IVPx(t)=et2+3et2t22
Mathematica. Time used: 0.013 (sec). Leaf size: 27
ode=D[x[t],{t,2}]-x[t]==t^2; 
ic={x[0]==0,Derivative[1][x][0] == 1}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
x(t)12(2(t2+2)+et+3et)
Sympy. Time used: 0.089 (sec). Leaf size: 20
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-t**2 - x(t) + Derivative(x(t), (t, 2)),0) 
ics = {x(0): 0, Subs(Derivative(x(t), t), t, 0): 1} 
dsolve(ode,func=x(t),ics=ics)
 
x(t)=t2+3et22+et2