20.2.11 problem Problem 11

Internal problem ID [3603]
Book : Differential equations and linear algebra, Stephen W. Goode and Scott A Annin. Fourth edition, 2015
Section : Chapter 1, First-Order Differential Equations. Section 1.4, Separable Differential Equations. page 43
Problem number : Problem 11
Date solved : Sunday, March 30, 2025 at 01:54:08 AM
CAS classification : [_separable]

\begin{align*} \left (x -a \right ) \left (x -b \right ) y^{\prime }-y+c&=0 \end{align*}

Maple. Time used: 0.002 (sec). Leaf size: 36
ode:=(x-a)*(x-b)*diff(y(x),x)-y(x)+c = 0; 
dsolve(ode,y(x), singsol=all);
 
\[ y = c +\left (x -b \right )^{-\frac {1}{-b +a}} \left (x -a \right )^{\frac {1}{-b +a}} c_1 \]
Mathematica. Time used: 0.092 (sec). Leaf size: 41
ode=(x-a)*(x-b)*D[y[x],x]-(y[x]-c)==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to c+c_1 (x-b)^{\frac {1}{b-a}} (x-a)^{\frac {1}{a-b}} \\ y(x)\to c \\ \end{align*}
Sympy. Time used: 0.860 (sec). Leaf size: 26
from sympy import * 
x = symbols("x") 
a = symbols("a") 
b = symbols("b") 
c = symbols("c") 
y = Function("y") 
ode = Eq(c + (-a + x)*(-b + x)*Derivative(y(x), x) - y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = c + e^{\frac {- C_{1} a + C_{1} b + \log {\left (- a + x \right )} - \log {\left (- b + x \right )}}{a - b}} \]