23.1.19 problem 2(i)

Internal problem ID [4109]
Book : Theory and solutions of Ordinary Differential equations, Donald Greenspan, 1960
Section : Chapter 2. First order equations. Exercises at page 14
Problem number : 2(i)
Date solved : Monday, January 27, 2025 at 08:09:04 AM
CAS classification : [_linear]

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

With initial conditions

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

Solution by Maple

Time used: 0.036 (sec). Leaf size: 22

dsolve([x*diff(y(x),x)+2*y(x)=(3*x+2)*exp(3*x),y(1) = 1],y(x), singsol=all)
 
\[ y \left (x \right ) = \frac {x^{2} {\mathrm e}^{3 x}-{\mathrm e}^{3}+1}{x^{2}} \]

Solution by Mathematica

Time used: 0.115 (sec). Leaf size: 22

DSolve[{x*D[y[x],x]+2*y[x]==(3*x+2)*Exp[3*x],y[1]==1},y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to -\frac {e^3}{x^2}+\frac {1}{x^2}+e^{3 x} \]