68.4.61 problem 59

Internal problem ID [17241]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 2. First Order Equations. Exercises 2.2, page 39
Problem number : 59
Date solved : Thursday, October 02, 2025 at 01:59:38 PM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (0\right )&=0 \\ \end{align*}
Maple. Time used: 0.020 (sec). Leaf size: 12
ode:=diff(y(x),x) = -(y(x)-2)/(x-2); 
ic:=[y(0) = 0]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {2 x}{x -2} \]
Mathematica. Time used: 0.017 (sec). Leaf size: 13
ode=D[y[x],x]==-(y[x]-2)/(x-2); 
ic={y[0]==0}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {2 x}{x-2} \end{align*}
Sympy. Time used: 0.154 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) + (y(x) - 2)/(x - 2),0) 
ics = {y(0): 0} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {2 x}{x - 2} \]