12.6.22 problem 22

Internal problem ID [1701]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. Exact equations. Section 2.5 Page 79
Problem number : 22
Date solved : Saturday, March 29, 2025 at 11:34:58 PM
CAS classification : [_separable]

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

With initial conditions

\begin{align*} y \left (1\right )&=-1 \end{align*}

Maple. Time used: 0.021 (sec). Leaf size: 23
ode:=(2*x-1)*(y(x)-1)+(x+2)*(x-3)*diff(y(x),x) = 0; 
ic:=y(1) = -1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {x^{2}-x +6}{\left (x +2\right ) \left (x -3\right )} \]
Mathematica. Time used: 0.037 (sec). Leaf size: 24
ode=((2*x-1)*(y[x]-1))+((x+2)*(x-3))*D[y[x],x]==0; 
ic=y[1]==-1; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {x^2-x+6}{x^2-x-6} \]
Sympy. Time used: 0.328 (sec). Leaf size: 15
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((x - 3)*(x + 2)*Derivative(y(x), x) + (2*x - 1)*(y(x) - 1),0) 
ics = {y(1): -1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {- x^{2} + x - 6}{- x^{2} + x + 6} \]