76.5.31 problem 32

Internal problem ID [17380]
Book : Differential equations. An introduction to modern methods and applications. James Brannan, William E. Boyce. Third edition. Wiley 2015
Section : Chapter 2. First order differential equations. Section 2.7 (Substitution Methods). Problems at page 108
Problem number : 32
Date solved : Monday, March 31, 2025 at 04:10:36 PM
CAS classification : [_linear]

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

Maple. Time used: 0.002 (sec). Leaf size: 19
ode:=(2-x)*diff(y(x),x) = y(x)+2*(2-x)^5; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\frac {\left (-2+x \right )^{6}}{3}+c_1}{-2+x} \]
Mathematica. Time used: 0.039 (sec). Leaf size: 26
ode=(2-x)*D[y[x],x]==y[x]+2*(2-x)^5; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {(x-2)^6-3 c_1}{3 (2-x)} \]
Sympy. Time used: 0.302 (sec). Leaf size: 36
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-2*(2 - x)**5 + (2 - x)*Derivative(y(x), x) - y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} + x^{6} - 12 x^{5} + 60 x^{4} - 160 x^{3} + 240 x^{2} - 192 x}{3 \left (x - 2\right )} \]