40.2.10 problem 34

Internal problem ID [6588]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 4. Equations of first order and first degree (Variable separable). Supplemetary problems. Page 22
Problem number : 34
Date solved : Sunday, March 30, 2025 at 11:10:48 AM
CAS classification : [_separable]

\begin{align*} 1+2 y-\left (4-x \right ) y^{\prime }&=0 \end{align*}

Maple. Time used: 0.001 (sec). Leaf size: 20
ode:=1+2*y(x)-(-x+4)*diff(y(x),x) = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {4 x -\frac {1}{2} x^{2}+c_1}{\left (x -4\right )^{2}} \]
Mathematica. Time used: 0.029 (sec). Leaf size: 34
ode=(1+2*y[x])-(4-x)*D[y[x],x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {-x^2+8 x+2 c_1}{2 (x-4)^2} \\ y(x)\to -\frac {1}{2} \\ \end{align*}
Sympy. Time used: 0.301 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x - 4)*Derivative(y(x), x) + 2*y(x) + 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1}}{2 \left (x^{2} - 8 x + 16\right )} - \frac {1}{2} \]