44.3.11 problem 19

Internal problem ID [6992]
Book : A First Course in Differential Equations with Modeling Applications by Dennis G. Zill. 12 ed. Metric version. 2024. Cengage learning.
Section : Chapter 1. Introduction to differential equations. Review problems at page 34
Problem number : 19
Date solved : Wednesday, March 05, 2025 at 04:01:32 AM
CAS classification : [_linear]

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

With initial conditions

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

Maple. Time used: 0.009 (sec). Leaf size: 18
ode:=x*diff(y(x),x)+y(x) = 2*x; 
ic:=y(x__0) = 1; 
dsolve([ode,ic],y(x), singsol=all);
 
\[ y = \frac {x^{2}-x_{0}^{2}+x_{0}}{x} \]
Mathematica. Time used: 0.021 (sec). Leaf size: 19
ode=x*D[y[x],x]+y[x]==2*x; 
ic={y[x0]==1}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {x^2-\text {x0}^2+\text {x0}}{x} \]
Sympy. Time used: 0.177 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*Derivative(y(x), x) - 2*x + y(x),0) 
ics = {y(x__0): 1} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = x + \frac {- \left (x^{0}\right )^{2} + x^{0}}{x} \]