Internal problem ID [237]
Book: Differential equations and linear algebra, 3rd ed., Edwards and Penney
Section: Section 5.5, Nonhomogeneous equations and undetermined coefficients Page
351
Problem number: 34.
ODE order: 2.
ODE degree: 1.
CAS Maple gives this as type [[_2nd_order, _linear, _nonhomogeneous]]
\[ \boxed {y^{\prime \prime }+y=\cos \left (x \right )} \] With initial conditions \begin {align*} [y \left (0\right ) = 1, y^{\prime }\left (0\right ) = -1] \end {align*}
✓ Solution by Maple
Time used: 0.0 (sec). Leaf size: 14
dsolve([diff(y(x),x$2)+y(x)=cos(x),y(0) = 1, D(y)(0) = -1],y(x), singsol=all)
\[ y \left (x \right ) = \frac {\left (-2+x \right ) \sin \left (x \right )}{2}+\cos \left (x \right ) \]
✓ Solution by Mathematica
Time used: 0.03 (sec). Leaf size: 17
DSolve[{y''[x]+y[x]==Cos[x],{y[0]==1,y'[0]==-1}},y[x],x,IncludeSingularSolutions -> True]
\[ y(x)\to \frac {1}{2} (x-2) \sin (x)+\cos (x) \]