2.1.7 Problem 2 (i)

Existence and uniqueness analysis
Solved using first_order_ode_autonomous
Maple
Mathematica
Sympy

Internal problem ID [18423]
Book : Elementary Differential Equations. By R.L.E. Schwarzenberger. Chapman and Hall. London. First Edition (1969)
Section : Chapter 3. Solutions of first-order equations. Exercises at page 47
Problem number : 2 (i)
Date solved : Monday, March 31, 2025 at 05:27:57 PM
CAS classification : [_quadrature]

Existence and uniqueness analysis

Solve

x=x23x+2

With initial conditions

x(0)=1

This is non linear first order ODE. In canonical form it is written as

x=f(t,x)=x23x+2

The x domain of f(t,x) when t=0 is

{<x<}

And the point x0=1 is inside this domain. Now we will look at the continuity of

fx=x(x23x+2)=2x3

The x domain of fx when t=0 is

{<x<}

And the point x0=1 is inside this domain. Therefore solution exists and is unique.

Solved using first_order_ode_autonomous

Time used: 0.103 (sec)

Solve

x=x23x+2

With initial conditions

x(0)=1

Since the ode has the form x=f(x) and initial conditions (t0,x0) are given such that they satisfy the ode itself, then we can write

0=f(x)|x=x00=0

And the solution is immediately written as

x=x0x=1

Singular solutions are found by solving

x23x+2=0

for 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.

x=1

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

Solution plot Slope field x=x23x+2

Summary of solutions found

x=1
Maple. Time used: 0.010 (sec). Leaf size: 5
ode:=diff(x(t),t) = x(t)^2-3*x(t)+2; 
ic:=x(0) = 1; 
dsolve([ode,ic],x(t), singsol=all);
 
x=1

Maple trace

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

Maple step by step

Let’s solve[ddtx(t)=x(t)23x(t)+2,x(0)=1]Highest derivative means the order of the ODE is1ddtx(t)Solve for the highest derivativeddtx(t)=x(t)23x(t)+2Separate variablesddtx(t)x(t)23x(t)+2=1Integrate both sides with respect totddtx(t)x(t)23x(t)+2dt=1dt+C1Evaluate integralln(x(t)2)ln(x(t)1)=t+C1Solve forx(t)x(t)=2+et+C1et+C11Redefine the integration constant(s)x(t)=2+C1etC1et1Use initial conditionx(0)=11=2+C1C11Solve for_C1No solutionSolution does not satisfy initial condition
Mathematica. Time used: 0.001 (sec). Leaf size: 6
ode=D[x[t],t]==x[t]^2-3*x[t]+2; 
ic={x[0]==1}; 
DSolve[{ode,ic},x[t],t,IncludeSingularSolutions->True]
 
x(t)1
Sympy
from sympy import * 
t = symbols("t") 
x = Function("x") 
ode = Eq(-x(t)**2 + 3*x(t) + Derivative(x(t), t) - 2,0) 
ics = {x(0): 1} 
dsolve(ode,func=x(t),ics=ics)
 
ValueError : Couldnt solve for initial conditions