7.9.9 problem 21

Internal problem ID [257]
Book : Elementary Differential Equations. By C. Henry Edwards, David E. Penney and David Calvis. 6th edition. 2008
Section : Chapter 2. Linear Equations of Higher Order. Section 2.2 (General solutions of linear equations). Problems at page 122
Problem number : 21
Date solved : Wednesday, February 05, 2025 at 03:06:19 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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

With initial conditions

\begin{align*} y \left (0\right )&=2\\ y^{\prime }\left (0\right )&=-2 \end{align*}

Solution by Maple

Time used: 0.010 (sec). Leaf size: 16

dsolve([diff(y(x),x$2)+y(x)=3*x,y(0) = 2, D(y)(0) = -2],y(x), singsol=all)
 
\[ y = -5 \sin \left (x \right )+2 \cos \left (x \right )+3 x \]

Solution by Mathematica

Time used: 0.011 (sec). Leaf size: 17

DSolve[{D[y[x],{x,2}]+y[x]==3*x,{y[0]==2,Derivative[1][y][0] ==-2}},y[x],x,IncludeSingularSolutions -> True]
 
\[ y(x)\to 3 x-5 \sin (x)+2 \cos (x) \]