36.2.20 problem 20

Internal problem ID [6313]
Book : Fundamentals of Differential Equations. By Nagle, Saff and Snider. 9th edition. Boston. Pearson 2018.
Section : Chapter 2, First order differential equations. Section 2.3, Linear equations. Exercises. page 54
Problem number : 20
Date solved : Wednesday, March 05, 2025 at 12:33:49 AM
CAS classification : [_linear]

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

With initial conditions

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

Maple. Time used: 0.009 (sec). Leaf size: 18
ode:=diff(y(x),x)+3*y(x)/x+2 = 3*x; 
ic:=y(1) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y \left (x \right ) = \frac {3 x^{2}}{5}-\frac {x}{2}+\frac {9}{10 x^{3}} \]
Mathematica. Time used: 0.032 (sec). Leaf size: 24
ode=D[y[x],x]+3*y[x]/x+2==3*x; 
ic={y[1]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {6 x^5-5 x^4+9}{10 x^3} \]
Sympy. Time used: 0.214 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-3*x + Derivative(y(x), x) + 2 + 3*y(x)/x,0) 
ics = {y(1): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {\frac {x^{4} \left (6 x - 5\right )}{10} + \frac {9}{10}}{x^{3}} \]