8.4.24 problem 24

Internal problem ID [727]
Book : Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section : Section 1.5. Linear first order equations. Page 56
Problem number : 24
Date solved : Saturday, March 29, 2025 at 10:16:07 PM
CAS classification : [_separable]

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

With initial conditions

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

Maple. Time used: 0.034 (sec). Leaf size: 15
ode:=3*x*y(x)+(x^2+4)*diff(y(x),x) = x; 
ic:=y(0) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {1}{3}+\frac {16}{3 \left (x^{2}+4\right )^{{3}/{2}}} \]
Mathematica. Time used: 0.036 (sec). Leaf size: 22
ode=3*x*y[x]+(x^2+4)*D[y[x],x] == x; 
ic=y[0]==1; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {16}{3 \left (x^2+4\right )^{3/2}}+\frac {1}{3} \]
Sympy. Time used: 0.337 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(3*x*y(x) - x + (x**2 + 4)*Derivative(y(x), x),0) 
ics = {y(0): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {1}{3} + \frac {16}{3 \left (x^{2} + 4\right )^{\frac {3}{2}}} \]