88.15.2 problem 2

Internal problem ID [24098]
Book : Elementary Differential Equations. By Lee Roy Wilcox and Herbert J. Curtis. 1961 first edition. International texbook company. Scranton, Penn. USA. CAT number 61-15976
Section : Chapter 4. Linear equations. Exercises at page 97
Problem number : 2
Date solved : Thursday, October 02, 2025 at 09:59:13 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} y^{\prime \prime }+4 y^{\prime }+4 y&=x^{2}-2 x +1 \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 24
ode:=diff(diff(y(x),x),x)+4*diff(y(x),x)+4*y(x) = x^2-2*x+1; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {9}{8}+\left (c_1 x +c_2 \right ) {\mathrm e}^{-2 x}+\frac {x^{2}}{4}-x \]
Mathematica. Time used: 0.009 (sec). Leaf size: 36
ode=D[y[x],{x,2}]+4*D[y[x],x]+4*y[x]==x^2-2*x+1; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {x^2}{4}+x \left (-1+c_2 e^{-2 x}\right )+c_1 e^{-2 x}+\frac {9}{8} \end{align*}
Sympy. Time used: 0.115 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2 + 2*x + 4*y(x) + 4*Derivative(y(x), x) + Derivative(y(x), (x, 2)) - 1,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x^{2}}{4} - x + \left (C_{1} + C_{2} x\right ) e^{- 2 x} + \frac {9}{8} \]