12.2.16 problem 16

Internal problem ID [1552]
Book : Elementary differential equations with boundary value problems. William F. Trench. Brooks/Cole 2001
Section : Chapter 2, First order equations. Linear first order. Section 2.1 Page 41
Problem number : 16
Date solved : Saturday, March 29, 2025 at 10:58:42 PM
CAS classification : [_linear]

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

Maple. Time used: 0.002 (sec). Leaf size: 19
ode:=diff(y(x),x)+y(x)/x = 7/x^2+3; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\frac {3 x^{2}}{2}+7 \ln \left (x \right )+c_1}{x} \]
Mathematica. Time used: 0.029 (sec). Leaf size: 24
ode=D[y[x],x] +1/x*y[x]==7/x^2+3; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {3 x}{2}+\frac {7 \log (x)}{x}+\frac {c_1}{x} \]
Sympy. Time used: 0.182 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(Derivative(y(x), x) - 3 + y(x)/x - 7/x**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {C_{1} + \frac {3 x^{2}}{2} + 7 \log {\left (x \right )}}{x} \]