81.7.1 problem 2

Internal problem ID [18619]
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, March 13, 2025 at 12:25:27 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 \left (x \right ) = -\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]
 
\[ y(x)\to -\cos (x)+c_2 x+c_1 \]
Sympy. Time used: 0.053 (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 )} \]