74.1.24 problem 31

Internal problem ID [15725]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 1. Introduction to Differential Equations. Exercises 1.1, page 10
Problem number : 31
Date solved : Thursday, March 13, 2025 at 06:16:33 AM
CAS classification : [_linear]

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

Maple. Time used: 0.001 (sec). Leaf size: 13
ode:=diff(y(x),x) = -2*y(x)/x-3; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -x +\frac {c_{1}}{x^{2}} \]
Mathematica. Time used: 0.025 (sec). Leaf size: 15
ode=D[y[x],x]==-2*y[x]/x-3; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -x+\frac {c_1}{x^2} \]
Sympy. Time used: 0.172 (sec). Leaf size: 8
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) + 3 + 2*y(x)/x,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1}}{x^{2}} - x \]