43.6.1 problem 1(a)

Internal problem ID [8915]
Book : An introduction to Ordinary Differential Equations. Earl A. Coddington. Dover. NY 1961
Section : Chapter 2. Linear equations with constant coefficients. Page 69
Problem number : 1(a)
Date solved : Tuesday, September 30, 2025 at 06:00:06 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }+4 y&=\cos \left (x \right ) \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 21
ode:=diff(diff(y(x),x),x)+4*y(x) = cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \sin \left (2 x \right ) c_2 +\cos \left (2 x \right ) c_1 +\frac {\cos \left (x \right )}{3} \]
Mathematica. Time used: 0.026 (sec). Leaf size: 53
ode=D[y[x],{x,2}]+4*y[x]==Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \sin (2 x) \int _1^x\frac {1}{2} \cos (K[1]) \cos (2 K[1])dK[1]+\cos (2 x) \left (\frac {\cos ^3(x)}{3}+c_1\right )+c_2 \sin (2 x) \end{align*}
Sympy. Time used: 0.037 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*y(x) - cos(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} \sin {\left (2 x \right )} + C_{2} \cos {\left (2 x \right )} + \frac {\cos {\left (x \right )}}{3} \]