49.21.13 problem 5(a)

Internal problem ID [7743]
Book : An introduction to Ordinary Differential Equations. Earl A. Coddington. Dover. NY 1961
Section : Chapter 5. Existence and uniqueness of solutions to first order equations. Page 190
Problem number : 5(a)
Date solved : Wednesday, March 05, 2025 at 04:54:19 AM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

\begin{align*} y^{\prime }&=\frac {x -y+2}{x +y-1} \end{align*}

Maple. Time used: 0.214 (sec). Leaf size: 33
ode:=diff(y(x),x) = (x-y(x)+2)/(x+y(x)-1); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {-\sqrt {1+8 \left (x +\frac {1}{2}\right )^{2} c_{1}^{2}}+\left (-2 x +2\right ) c_{1}}{2 c_{1}} \]
Mathematica. Time used: 0.162 (sec). Leaf size: 53
ode=D[y[x],x]==(x-y[x]+2)/(x+y[x]-1); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to -\sqrt {2 x^2+2 x+1+c_1}-x+1 \\ y(x)\to \sqrt {2 x^2+2 x+1+c_1}-x+1 \\ \end{align*}
Sympy. Time used: 2.158 (sec). Leaf size: 41
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((-x + y(x) - 2)/(x + y(x) - 1) + Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ \left [ y{\left (x \right )} = - x - \frac {\sqrt {C_{1} + 8 x^{2} + 8 x}}{2} + 1, \ y{\left (x \right )} = - x + \frac {\sqrt {C_{1} + 8 x^{2} + 8 x}}{2} + 1\right ] \]