75.7.1 problem 2

Internal problem ID [19983]
Book : A short course on differential equations. By Donald Francis Campbell. Maxmillan company. London. 1907
Section : Chapter VI. Certain particular forms of equations. Exercises at page 74
Problem number : 2
Date solved : Thursday, October 02, 2025 at 05:04:46 PM
CAS classification : [[_2nd_order, _quadrature]]

\begin{align*} y^{\prime \prime }&=\cos \left (x \right ) \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 13
ode:=diff(diff(y(x),x),x) = cos(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\cos \left (x \right )+c_1 x +c_2 \]
Mathematica. Time used: 0.004 (sec). Leaf size: 16
ode=D[y[x],{x,2}]==Cos[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\cos (x)+c_2 x+c_1 \end{align*}
Sympy. Time used: 0.027 (sec). Leaf size: 10
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-cos(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} + C_{2} x - \cos {\left (x \right )} \]