74.2.7 problem 12

Internal problem ID [15769]
Book : INTRODUCTORY DIFFERENTIAL EQUATIONS. Martha L. Abell, James P. Braselton. Fourth edition 2014. ElScAe. 2014
Section : Chapter 1. Introduction to Differential Equations. Review exercises, page 23
Problem number : 12
Date solved : Thursday, March 13, 2025 at 06:18:36 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

Maple. Time used: 0.003 (sec). Leaf size: 25
ode:=diff(diff(y(x),x),x)+2*diff(y(x),x)+2*y(x) = x; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (x \right ) {\mathrm e}^{-x} c_{2} +{\mathrm e}^{-x} c_{1} \cos \left (x \right )-\frac {1}{2}+\frac {x}{2} \]
Mathematica. Time used: 0.017 (sec). Leaf size: 33
ode=D[y[x],{x,2}]+2*D[y[x],x]+2*y[x]==x; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to \frac {x-1}{2}+c_2 e^{-x} \cos (x)+c_1 e^{-x} \sin (x) \]
Sympy. Time used: 0.183 (sec). Leaf size: 22
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x + 2*y(x) + 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \frac {x}{2} + \left (C_{1} \sin {\left (x \right )} + C_{2} \cos {\left (x \right )}\right ) e^{- x} - \frac {1}{2} \]