32.2.39 problem 40

Internal problem ID [7756]
Book : Engineering Mathematics. By K. A. Stroud. 5th edition. Industrial press Inc. NY. 2001
Section : Program 24. First order differential equations. Further problems 24. page 1068
Problem number : 40
Date solved : Tuesday, September 30, 2025 at 05:04:52 PM
CAS classification : [[_homogeneous, `class C`], _rational, [_Abel, `2nd type`, `class A`]]

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

With initial conditions

\begin{align*} y \left (1\right )&=1 \\ \end{align*}
Maple. Time used: 0.154 (sec). Leaf size: 17
ode:=diff(y(x),x) = (x-2*y(x)+1)/(2*x-4*y(x)); 
ic:=[y(1) = 1]; 
dsolve([ode,op(ic)],y(x), singsol=all);
 
\[ y = \frac {x}{2}+\frac {\sqrt {-2 x +3}}{2} \]
Mathematica. Time used: 0.076 (sec). Leaf size: 24
ode=D[y[x],x]==(x-2*y[x]+1)/(2*x-4*y[x]); 
ic={y[1]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{2} \left (x-i \sqrt {2 x-3}\right ) \end{align*}
Sympy. Time used: 0.700 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - (x - 2*y(x) + 1)/(2*x - 4*y(x)),0) 
ics = {y(1): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x}{2} + \frac {\sqrt {3 - 2 x}}{2} \]